Enhance cache modes in resource loading
- Unify documentation, hoping to clear misconcepctions about about propagation of the cache mode across dependant loads. - Clarify in docs that `CACHE_MODE_REPLACE` now also works on the main resource (from #87008). - Add two recursive modes, counterparts of `CACHE_MODE_REPLACE` and `CACHE_MODE_IGNORE`, since it seems some need them (see #59669, #82830). - Let resources, even loaded with one of the ignore-cache modes, get a path, which is useful for tools.
This commit is contained in:
parent
bb6b06c813
commit
5e144022e7
15 changed files with 104 additions and 28 deletions
|
|
@ -99,10 +99,19 @@
|
|||
</methods>
|
||||
<constants>
|
||||
<constant name="CACHE_MODE_IGNORE" value="0" enum="CacheMode">
|
||||
Neither the main resource (the one requested to be loaded) nor any of its subresources are retrieved from cache nor stored into it. Dependencies (external resources) are loaded with [constant CACHE_MODE_REUSE].
|
||||
</constant>
|
||||
<constant name="CACHE_MODE_REUSE" value="1" enum="CacheMode">
|
||||
The main resource (the one requested to be loaded), its subresources, and its dependencies (external resources) are retrieved from cache if present, instead of loaded. Those not cached are loaded and then stored into the cache. The same rules are propagated recursively down the tree of dependencies (external resources).
|
||||
</constant>
|
||||
<constant name="CACHE_MODE_REPLACE" value="2" enum="CacheMode">
|
||||
Like [constant CACHE_MODE_REUSE], but the cache is checked for the main resource (the one requested to be loaded) as well as for each of its subresources. Those already in the cache, as long as the loaded and cached types match, have their data refreshed from storage into the already existing instances. Otherwise, they are recreated as completely new objects.
|
||||
</constant>
|
||||
<constant name="CACHE_MODE_IGNORE_DEEP" value="3" enum="CacheMode">
|
||||
Like [constant CACHE_MODE_IGNORE], but propagated recursively down the tree of dependencies (external resources).
|
||||
</constant>
|
||||
<constant name="CACHE_MODE_REPLACE_DEEP" value="4" enum="CacheMode">
|
||||
Like [constant CACHE_MODE_REPLACE], but propagated recursively down the tree of dependencies (external resources).
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue