Skip Navigation

[Resolved] Can't stop Caching Views even w/ wpv_filter_disable_caching and always generate?

This support ticket is created 5 years, 1 month 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.

This topic contains 4 replies, has 2 voices.

Last updated by Dylan Harris 5 years, 1 month ago.

Assigned support staff: Minesh.

Author
Posts
#507890

I am trying to: Disable caching on all Views content on the front-end (per client request).

I added this filter to functions.php

 add_filter( 'wpv_filter_disable_caching', '__return_true' ); 

as instructed in this thread: https://toolset.com/forums/topic/disabling-cache-on-wpv-form-views-called-in-php-template/

I also set cached=off in every View throughout the site, like this

[wpv-view name="all-properties" cached="off"]

as advised here: https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/

When publishing a new Property (CPT) there is still a delay of up to several hours, which I assume is the GoDaddy Managed WordPress caching mu plugins in effect.

However, when publishing a normal blog post, the post appears immediately. So the cache is ONLY affecting the Views content.

When the cache is flushed (GD Managed WP provides a "Flush Cache" button) the Views content appears immediately.

The client does not want to have to click the Flush Cache button each time - is there ANY other way to prevent Views from being cached??

The debug info I provided is for a staging version of the site that's identical to the production site. I've replicated the exact same issue on both. I can provide full access to the staging site if needed.

Please advise. Thanks guys!

#508069

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

First of all, I checked the debug information you shared with us and I found that you are using outdated views plugin. The latest views plugin version is 2.3.1. You can download it from:
=> https://toolset.com/account/downloads/

Regarding cache issue - this issue is really related to your hosting provider GoDaddy and its popular one. I found one help page which will guide you to bypass the managed WP cache:
=> hidden link

Or - See following complaints where user advise to switch to another host:
=> http://stackoverflow.com/questions/25423814/godaddy-cache-issue-with-wordpress-project
=> hidden link

#508534

Thanks Minesh

Views has been updated, thanks for pointing that out!

I was afraid this would be your answer. I understand the GoDaddy Managed WordPress caching is difficult to deal with.

But do you happen to know - or can you provide documentation for - the reason why normal WordPress Posts are not cached in this manner (they appear immediately when Published) but Views CPTs are cached?

What is the difference between normal posts and Views CPT output if we are telling Views to bypass the cache?

Is there ANY way to write a function that tells WordPress to treat a CPT the same a default Post? (I know that's an oversimplified question for a complex issue).

At the end of the day, I understand the issue itself is with GoDaddy's cache - but I very greatly appreciate any additional insight you guys can provide on this issue.

Thanks again!

#508949

Minesh
Supporter

Languages: English (English )

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

What is the difference between normal posts and Views CPT output if we are telling Views to bypass the cache?
===>
Views offer the way to bypass the cache and you already tried that by adding the attribute to views shortcode cached="off" but the thing is that what if your hosting authority prevents the view's query.

Is there ANY way to write a function that tells WordPress to treat a CPT the same a default Post? (I know that's an oversimplified question for a complex issue).
===>
We would like to help you but the thing is that how can we control GoDaddy caching. We simply can not control it.

You can check with following links if that may help you:
=> hidden link
=> http://wordpress.stackexchange.com/questions/167128/prevent-wordpress-from-sending-cache-control-http-header

#510894

Understood, thanks for the additional info Minesh. Keep up the good work!