#26507 closed New feature (duplicate)
Add autoreloading to the cached template loader
Reported by: | Sven R. Kunze | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
A while ago, we started using {{ django.template.loaders.cached.Loader }} for performance reasons.
Today, we noticed that we needed to restart the runserver each time we changed the template.
Would you accept a patch to the cached.Loader which respects the mtime of a loaded template?
Change History (2)
comment:1 by , 9 years ago
Component: | Core (Cache system) → Template system |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Summary: | django.template.loaders.cached.Loader respecting mtime of templates → Add autoreloading to the cached template loader |
comment:2 by , 9 years ago
Thanks Tim for finding the related issue.
I don't know if I would agree with the new title. Actually, I do not want to reload/replace the already loaded template.
Looking at the source, I would say, we could make 'Loader.cache_key' respect the mtime of the first found template.
So, they are two versions of the template in the cache but a cache does not need to be perfect after all and the increased memory footprint would not even matter in development.
Duplicate of #25791