From 2d114b5a2d2023853048e8aa87369311788edbf3 Mon Sep 17 00:00:00 2001 From: Gunnar Date: Fri, 28 Jun 2024 11:56:01 +0200 Subject: [PATCH] Update view-caching.md add clarification what will be cached, link event caching --- the-basics/layouts-and-views/views/view-caching.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/the-basics/layouts-and-views/views/view-caching.md b/the-basics/layouts-and-views/views/view-caching.md index b1dae4c2..8bf3c17b 100644 --- a/the-basics/layouts-and-views/views/view-caching.md +++ b/the-basics/layouts-and-views/views/view-caching.md @@ -15,8 +15,10 @@ component name="general"{ function index(event,rc,prc){ // call some model for data and put into the request collection + // this data will not be cached, the service will still be called for each request prc.myQuery = getInstance('MyService').getData(); // view with caching parameters + // even if data changes in prc.myQuery, the cached view will be returned event.setView( view="general/index", cache=true, @@ -29,6 +31,13 @@ component name="general"{ } ``` +If you want the data and view cached, you might consider [event caching](/the-basics/event-handlers/event-caching) + + + + + + ## Purging Views So now that our views are cached, how do I purge them programmatically? Well, you need to talk to the `template` cache provider and use the clearing methods: