Feature: #64200 - Allow individual content caching
See forge#64200
Description
The std
property is now available as first-class function to all
content objects. This skips the rendering even for content objects that evaluate
std
after rendering (e.g. COA
).
Usage:
page = PAGE
page.10 = COA
page.10 {
cache.key = coaout
cache.lifetime = 60
#stdWrap.cache.key = coastdWrap
#stdWrap.cache.lifetime = 60
10 = TEXT
10 {
cache.key = mycurrenttimestamp
cache.lifetime = 60
data = date : U
strftime = %H:%M:%S
noTrimWrap = |10: | |
}
20 = TEXT
20 {
data = date : U
strftime = %H:%M:%S
noTrimWrap = |20: | |
}
}
The commented part is std
property available since 4.7,
that does not stop the rendering of COA
including all sub-cObjects.
Additionally, stdWrap support is added to key, lifetime and tags.
Impact
If you've previously used the cache.
property in your custom cObject,
this will now fail, because cache.
is unset to avoid double caching.
You are encouraged to rely on the core methods for caching cObjects or
rename your property.
std
continues to exists and can be used as before. However
the top level std
of certain cObjects (e.g. TEXT
cObject)
will not evaluate cache.
as part of std
, but before starting
the rendering of the cObject. In conjunction the storing will happen
after the std
processing right before the content is returned.
Top level cache.
will not evaluate the hook
$GLOBALS
any more.