CachedStaticFilesStorage only populates the file name cache once, never updates
|Reported by:||mkai||Owned by:||nobody|
|Cc:||Jannis Leidel||Triage Stage:||Accepted|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I noticed that the cache that CachedStaticFilesStorage uses for performance reasons (i. e. to avoid having to recalculate the MD5 hash for a file's contents) is populated only once, during collectstatic. Therefore, if memcached goes down and needs to be restarted, it will need to recalculate the MD5 hash for every subsequent static file request, because the cache query will always miss.
I suggest that if a cache query misses, the corresponding file name in the cache should be updated/ rewritten.