Skip Navigation

[Resolved] enable Caching for Views

This support ticket is created 4 years, 6 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 1 reply, has 2 voices.

Last updated by Waqar 4 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#1670727
Bildschirmfoto 2020-06-20 um 16.17.00.png

Tell us what you are trying to do?
Hello, we have a very bad pagespeed that changes on every new test, we have a very fast Server and could not find a solution.
I was very happy that there is a improved caching function released this year.
Unfortunately i wan't able to enable caching for all Views we are using. We did no modifacation to the shortcodes but in the backend, views shows a "clear cache" Button on one view but on all other views it says "Not cached" (see screenshot).
This also did not change when we modified the shortcode to contain cached="on".
Can you help me out and tell me, how to enable caching for all views?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?
hidden link

#1672119

Hi,

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

The way built-in cache feature works for view, 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.

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

Tip: When working to optimize the page loading times, the focus should be on improving the loading of static content like images, CSS and script files, etc. Using an aggressive cache for dynamic data like list of posts created using views can result in out-dated or changed data showing unexpectedly and for longer than desired.

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

regards,
Waqar