What do the getFromCache and saveToCache presets do?

What do the getFromCache and saveToCache presets do?

by Mike Churchward -
Number of replies: 1
Picture of Core developers Picture of Plugin developers Picture of Testers

In some of the plugins that have mobile app support, and in the documentation, I see the option:

[preSets]="{getFromCache: 0, saveToCache: 0}"

What does this actually do?

Average of ratings: -
In reply to Mike Churchward

Re: What do the getFromCache and saveToCache presets do?

by Pau Ferrer Ocaña -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers
Hi Mike!

Those presets are settings about how it will behave the cache of the webservice call. Those presets are defined by the type CoreSiteWSPreSets.

getFromCache is a boolean and, if true, will get the value from the cache if it's still valid.
saveToCache is also a boolean and will save the results of the call to the cache when true.

When used on templates of site Plugins it specifies the same, since you can specify what WS to call and the parameters it also specify those presets for the call.

Does this description resolve your questions?

Have a great end of year!

Pau