Skip Navigation

[Resolved] Cache for 1 View but not Others

This support ticket is created 3 years, 12 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by saint 3 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#1959091

Hi Team - I am trying to understand how only 1 of the View is cached, but all of the other ones are not. I know it's only a View of a hyperlink vs. a View of Taxonomy terms, but wouldn't they both be the same?

hidden link

#1962233

Hi,

Thank you for contacting us and I'd be happy to assist.

The way the built-in cache feature works for views, you can force it in two ways:

a). In a view created using the Blocks editor, you'll find a "Cache View" option under the main "View" block's settings.
( screenshot: hidden link )

b). For a view created using the classic views editor, you can force cache through cached="force" attribute in the views shortcode.
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-view )

Example:

	
[wpv-view name="slug-of-view" cached="force"]

It is important to note however that there are certain conditions, which will force the view to not use the cached version, for example:

- if the view is using front-end sorting controls
- If the view contains a query filter that listens to the URL parameter
- if the view contains a nested view or a content template
- if the view is set to show posts in a random order
- if the view contains the "conditional" block

I hope this information helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1962379

Thank you Waqar! If I force the cache to be "force cached", then how would I make sure it is un-cached when I need it to?

I ask because as I am currently developing... I don't need it cached (actually - just the opposite!) But when it's in production... I would like to cache as much as possible.

#1962725

On a production website where you'd like to make use of view's built-in cache feature, you can follow the steps from my last message.

And, to avoid view's built-in cache, on a development website you can disable the "Cache View" option in the Blocks based views and set cached="off" if you're using the view's shortcode:
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-view )


[wpv-view name="slug-of-view" cached="off"]

#1963021

Hi Waqar,

Great, that is good to know. I'd like to suggest a UX improvement to make the workflow better.

If I have to do cached="off" for _each_ view I create, it will be a pain to go into each View and change that from 'off' to 'forced' or neutral. Especially if you have 30+ Views and have to flip them all (and even back if needed.)

Is there some sort of bulk function that could help make the UX/process better? If not, could this be a Feature Request?

Thank you!

#1963607

Thanks for writing back.

I'm afraid, there is no bulk control or setting available for this, but, I'll be happy to pass this on internally.

#1969743

Thank you Waqar! If you could help pass along the suggestion of bulk control, that'd be appreciated.

>> It is important to note however that there are certain conditions, which will force the view to not use the cached version, for example:

- if the view contains a nested view or a content template
- if the view is set to show posts in a random order
- if the view contains the "conditional" block

Also, for the below, do you know if there are any plans to integrate deeper with software like Redis, NGINX, LiteSpeed so that these cache can be sync'd/linked and taken up by them? If not, could I put in a feature request for consideration?