Hi
The Toolset view on the homepage of my site for blog posts (scroll to the bottom) seems to be caching and not clearing.
There is a more recent blog post but its not showing.
I am using WP Rocket and the cache clears every 10 hours, yet its been over 24 hours and its not showing on the homepage.
Any ideas?
Hi, so I understand there are multiple caching systems involved. Let's try to narrow it down. If you explicitly disable Views caching for this View, does it show the expected results? For Views implemented with shortcodes, you can turn off Views caching like so:
[wpv-view name="your-view-slug" cached="off"]
For Views created in the Block Editor, you can disable the Cache option when you select the top-level View block.
OK that worked 🙂
Do you recommend I simply leave Toolset caching off then for views that are in pages cached by WP Rocket?
I would have thought Toolset integrated with WP Rocket being such a big plugin? E.g. if WP Rocket cache is cleared then Toolset's is?
Do you recommend I simply leave Toolset caching off then for views that are in pages cached by WP Rocket?
Sure, that should be fine. Caching is automatically disabled in certain situations anyway, as explained in this document:
https://toolset.com/documentation/legacy-features/views-plugin/how-to-use-views-parametric-search-on-large-sites/
I would have thought Toolset integrated with WP Rocket being such a big plugin? E.g. if WP Rocket cache is cleared then Toolset's is?
Toolset Views caching is implemented in the database, whereas from what I understand WP Rocket creates a static HTML version of pages that are normally created dynamically by querying the server/database, to speed up page load times. There is no integration between the two types of caching - clearing one does not necessarily clear the other. If a View is cached when Rocket creates its static version of the page, the cached View results will be used to generate the static version of the page. If the View cache is then cleared manually, that does not trigger a Rocket cache update, and vice versa. You would need to clear the cache from both systems to see the changes effected on the live site.
Ah OK Christian that makes perfect sense.
How often does the Toolset view cache clear? As WP Rocket is set to clear every 10 hours anyway.
So I am thinking maybe we could leave both enabled but that didn't seem to be working to be fair.
Thanks.
How often does the Toolset view cache clear?
From the document I shared:
Things that also change the content or the status of posts, terms, or users will invalidate cache automatically. For example, when you update a post or create a new taxonomy term. The Views plugin automatically invalidates cache after 24 hours.
Right OK I see, so an integration could in theory then tell the WP Rocket cache to invalidate when Toolset invalidates its cache? This is what quite a few other plugins do.
Can I suggest this feature? WP Rocket has hooks for this.
I'll ask my 2nd tier support team if there is a hook available when Views cache is invalidated, or if it's possible to create a feature request to integrate directly with WP Rocket. I'll let you know what I find out.
I have some feedback from our lead developer, who is hesitant to implement something like this as explained here:
There is no out of the box solution for this, mostly because we do not delete that cache ourselves. We use the transients API, which is a temporary cahe where you can set the maximum lifespan for the data, but WordPress itself manages checking and invalidating it when needed.
There are native actions that run when the transient is deleted, and they can check against the transient key. But our keys are sometimes dynamic, hence we might need to guess that WP is indeed removing one of our transients, adding some complexity and logic every time this happens, for any transient, which would be an expensive operation.
It seems that turning off Views cache manually is the best option here. Any time WP Rocket's cache invalidates, it will update to show the latest information in the View.
OK no problem thanks for your help Christian 🙂