Skip Navigation

[Resolved] View – Query Filters

This support ticket is created 5 years, 10 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)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 5 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1179857

Hi,

I had the following queries with relation to view's query filters

(a) Caching with parametric searches
I was going through the following documentation: https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/

This mentions that caching is automatically turned off, under a given set of circumstances, including if a user is loading a custom search View after performing a search.

I just wanted to confirm if my understanding is correct -- if I create a view that displays for example a list of books, and there is an exposed query filter that allows a user to filter based on the authors -- can such a view be cached or not?

(b) Cache invalidation
The same article mentions -- Things that also change the content or the status of posts, terms, or users will invalidate cache automatically.

I had read another post (can't seem to find the link) that mentions that seemed to suggest that changing any content would invalidate all view caches across the site (since it is difficult for the view to be contextually aware of how content is linked).

Is there any way to change this default behaviour -- either directly through views caching or via a 3rd party cache plug-in? Specifically if I am ok displaying certain stale content, to help boost site performance.

(c) Query on Custom Post type
My aim was to create a taxonomy archive, that has an exposed filter that allows a user to filter based on the custom post type. However, while creating the view, there does not seem to be an option to filter on custom post type and I have read a previous support request which seemed to suggest that views queries do not support filtering on the post types.

Just wanted to confirm if this is possible or not, and if not, is this planned for future releases.

Look forward to your responses.

#1179928

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I will try to answer your every question that will help you to eliminate the doubts.

(a) Caching with parametric searches
I was going through the following documentation: https://toolset.com/documentation/user-guides/front-page-filters/how-to-use-views-parametric-search-on-large-sites/

This mentions that caching is automatically turned off, under a given set of circumstances, including if a user is loading a custom search View after performing a search.

I just wanted to confirm if my understanding is correct -- if I create a view that displays for example a list of books, and there is an exposed query filter that allows a user to filter based on the authors -- can such a view be cached or not?
==> No, such view will not be cashed as its not logical because when you filter the view by author it will have different result.

(b) Cache invalidation
The same article mentions -- Things that also change the content or the status of posts, terms, or users will invalidate cache automatically.

I had read another post (can't seem to find the link) that mentions that seemed to suggest that changing any content would invalidate all view caches across the site (since it is difficult for the view to be contextually aware of how content is linked).

Is there any way to change this default behaviour -- either directly through views caching or via a 3rd party cache plug-in? Specifically if I am ok displaying certain stale content, to help boost site performance.
==> Well - The Views plugin automatically invalidates cache after 24 hours in such cases when content is changed. I do not have any third party plugin but feel free to try the cache plugin that suits your requirement. I cant to anything here as this is what plugin is doing natively. We cant change the plugin source code.

(c) Query on Custom Post type
My aim was to create a taxonomy archive, that has an exposed filter that allows a user to filter based on the custom post type. However, while creating the view, there does not seem to be an option to filter on custom post type and I have read a previous support request which seemed to suggest that views queries do not support filtering on the post types.
==> Yes, thats correct and in addition to that you can build a custom search view with post type views only. Custom search is not supported by taxonomy and user views.