Is there somewhere where I can read more about the Improved the front-end caching system for Views and archives introduced in Views 3.1.0?
How does it work? After I updated from 3.0.2 today I noticed a new post not showing up and I needed to clear the frontend view cache manually for it show up for logged in user. I then again had to clear WP Rocket cache for it to show up for users not logged in.
I hope I do not have to do this from now on? Can it be turned off or do I have to go back to 3.0.2 where it worked fine.
Hi, I just checked our internal tickets about this changelog entry. The Views caching mechanism was improved to add WPML support and caching in all languages. You can also see caching information about each View by going to Toolset > Views. There is a column in the listing that explains whether or not the View's information has been cached. The Views cache should now be invalidated when:
- creating, deleting or editing an object from the family of the ones returned by the View. For example, if a View lists posts of the custom type book, when a new book is created, or one is edited or deleted; likewise, when listing categories, or when lsiting users with a role of administrator.
- editing the View itself.
- clicking the admin listing page column button that offers to just do that cache cleaning.
You can manually turn off Views caching for any View by adding cached="off" to the shortcode:
[wpv-view name="Your View name" cached="off"]
Caching by WP Rocket is completely independent of Views caching, so you would have to refer to their documentation to understand when caches are cleared and when you must manually clear them.
Thanks for your reply. The new version does not seem invalidate the cache from the family of the ones returned by the View for me. Even when WP Rocket is not active. Adding cached="off" seems like a lot of work as I use many views on different posts...
My clone site does not seem to have the issue. So I will investigate further.
I will stand by for your update.
After some extended testing it turned out to be something to do with transients in the DB. I was able to reproduce after a new clone of my production site. Then I did a DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_transient\_%') on the production site db. After that I have tested several times and new posts end edit posts are reflected in the view unlike before.
My issue is resolved now. Thank you!