Skip Navigation

[Resolved] Load views as cached html

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)

This topic contains 5 replies, has 1 voice.

Last updated by Minesh 2 months, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2793098

(1) We need the view to load as rendered, so it can be cached by wp-rocket full page caching. (2) We need to use redis object caching to its fullest extent, including fragment caching.z
(3) We need the view to use ajax to load the view after any user interaction.

So if Toolset always load the view via ajax, then yes we would need to modify Toolset to do this. We can even wrap toolset views shortcode in our own shortcode to control things more. And Toolset shortcode offers this shortcode to force toolset views caching: [wpv-view name="slug-of-view" cached="force"]/

#2793139

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

By default view's cache is on.

if you want to stop the view's caching then you will have to use attribute cached="off":

[wpv-view name="my-view" cached="off"]

But you can find more information about how view caching works - there are certain key points when view caching is tured off automatically:
- https://toolset.com/documentation/legacy-features/views-plugin/how-to-use-views-parametric-search-on-large-sites/

#2793183

We need cached on.

But Views load via admin-ajax. We want them to be rendered server side and be part of the page's html. Not load via ajax.

#2793191

need help

#2793259

Minesh
Supporter

Languages: English (English )

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

Please understand that views are meant to render and use on the frontend. You can build the views from backend and display the output of the views on frontend.

If I'm not wrong you want to render the view output in the backend admin after you build the view but there is no such feature available.

#2793933

No. I want the view to be rendered on the frontend, before the pages loads, so that the view is part of the rendered html, so it can be cached by full page caching.

Right now, all my views load after the cached page loads, and the views load via admin ajax. I also must have the views pagination and search buttons work with admin ajax.

#2794212

Minesh
Supporter

Languages: English (English )

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

Normally - WordPress generates/render the page (which means creating the HTML shipped to the browser) it renders the shortcodes included in the content, including the shortcode to output the markup of the View, so that the generated page already includes the View output. A caching plugin will cache the whole page markup (before sending to browser) and then then the rendered output is sent to the browser.

I'm not sure why you have admin ajax request at first load of the page.

Here is a sandbox site and you can auto-login to it using the following link:
- hidden link

When I load the following page where the custom search view with map is added:
- hidden link
I do not see it runs admin AJAX request when loaing the above page first time.