|
This is how caching works currently:
- By default TemplateLoader are queried for values every 5 seconds. This can be changed at configuration level by calling Configuration.setTemplateUpdateDelay(int seconds).
- When called, following sequence is executed:
- loader.findTemplate()
- loader.getLastUpdateDate()
- loader.getReader()
so IMHO caching the update date doesn't solve anything.
What we might want to do is to change the interval in which cached entries are rechecked for update, or set this interval to "never" and manually flush the template cache on template update.
At the moment I can't see any slowdown or significant overhead with current settings. Timing the operations above shows on average cca 1ms execution time for each op.
Note: The update interval is time elapsed since any given template was checked last time, not the fixed tick applied to all templates every time template is requested.
|