Skip Navigation

[Resolved] Question: I’ve set cached=”off” on all of my views, is that recommended?

This thread is resolved. Here is a description of the problem and solution.

Problem:

Is it recommended that for a dynamic web application, we set the cached attribute to off (cached="off") or can we leave it on to gain performance? Will record updates be reflected immediately on the views or retrieve cached data?

Solution:

You can set the cached attribute to on by removing attribute cached="off", it will gain performance.
The record updates will be reflected immediately on the views in most cases.

Relevant Documentation:

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

This support ticket is created 5 years, 8 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/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by Mukesh 5 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1241965

I just have a question. I've built a database application (dynamic application) using Toolset Plugins where users creates records and update records via different CRED forms. I'm using Views to show those records in various screens filtered by queries (based on custom fields they enter). All the views I've set the cached=off property. Is it recommended that for a dynamic web application, we set the cached attribute to off (cached="off") or can we leave it on to gain performance? Will record updates be reflected immediately on the views or retrieve cached data? Just wanting to get some direction so improve performance of the app.

#1241991

Hello,

You can set the cached attribute to on by removing attribute cached="off", it will gain performance.
The record updates will be reflected immediately on the views in most cases.

See our document:
https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/

For example, when you update a post or create a new taxonomy term. The Views plugin automatically invalidates cache after 24 hours.

#1242299

Thanks Luo. So if a post/record is updated via the CRED Post Form, does that trigger an invalidation? Or do you mean that when a Post is updated, the invalidation will not happen for 24 hours and so on other views that same Post will still show old information?
Thanks,
Mukesh

#1242841

There is a misunderstand, it means these:
1) If a post/record is updated via the CRED Post Form, that will trigger an invalidation.
2) And the Views cache will be invalidated after 24 hours automatically.

#1243204

Thanks Luo.

Just one additional question. What best way can you suggest to debug/troubleshoot query performance for a View? What can I look into or do to see why some of my Views are taking 15 seconds to run. Our Posts database is just over 3,700 posts so it shouldn't be data volume. But could be something I am doing. For most of my views, I use the Query Filter and then within the loop I have IF statements to filter out more records from the view. For some complex Queries that can't be done via the QUery Filter, I'm using the wpv_filter_query FILTER.

Thanks,
Mukesh

#1243331
#1244797

My issue is resolved now. Thank you!