Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions the-basics/layouts-and-views/views/view-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down