Open fluffy-critter opened 4 years ago
Note that Jinja will also need to be configured to reload templates when they change, to avoid a race condition where Publ's cache key doesn't change in lock step with Jinja's template cache. See https://stackoverflow.com/a/43606759/318857 for a possible fix.
... Except this also doesn't cover the case when the changed template is brought in via Jinja directive such as include
or extends
. Unclear how to actually fix this issue correctly; perhaps the ongoing guidance should be to require an app restart and possibly a cache flip whenever templates change.
How about: have Jinja reload templates when they change (per the stackoverflow link), and have a watchdog watch the template directory and bump the templating cache key whenever that changes. Now, what to bump the cache key with, to ensure that it doesn't screw up a distributed cache in a load-balanced scenario...
Expected Behavior
When a template's file fingerprint changes, the
do_render
cache key should change.Current Behavior
It does not, causing old template data to persist.
Possible Solution
Include template file fingerprint as part of the cache key.
Steps to Reproduce (for bugs)
1. 2. 3. 4.
Context