Skip Navigation

[Resolved] Caching issue with views

This support ticket is created 2 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by Rita 2 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2350051
Screenshot 2022-04-26 at 23.41.50.png
Screenshot 2022-04-26 at 23.42.13.png

Hi there

I have a problem with 3 views that display the latest of their specified posts on the website's homepage.

One of the views, in particular, is ordered by a date custom field to display the next 'event' post type first.

The problem is that these 3 views keep caching so the latest post that should be displays is not because the old post is cached.

I have added the wpv_filter_disable_caching filter to block the caching on these views but they continue to cache. The only way to display the correct posts on the front end is to log in and clear the views cache manually. For one of the views a new cache is created immediately.

See screenshots:

1. The filter in functions.php to prevent cache

2. The 3 views that keep caching

Website:

You can see the three views displayed on the homepage - hidden link - under the following headings:

1. The Balanceo Collection - view of product posts filtered by 'if a custom field checkbox has a value of 1' and ordered by Field - modified, descending

2. News and other stories - view of story posts ordered by post date, descending.

3. Try them on! - view of event post ordered by Field - wpcf-event-start-date, ascending. (not included in screenshots)

I can't figure out how to stop this caching on these views...

Any advice would be hugely appreciated!

Rita

#2350329

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I'm not sure how exactly you are displaying your view. What if you add the cached="off" attribute to your view's shortcode to disable the cache:

For example:

[wpv-view name="your-view-slug" cached="off"]
#2350353

Hi Minesh
Hope you are well.
Ok brilliant, that seems to have resolved the problem entirely.
Thank you! 🙂
Rita