Cache S3 key metadata to avoid unnecessary calls especially with collectstatic
Relates to https://github.com/jschneier/django-storages/issues/1255
When running collectstatic S3 key check first the existence and the last modification time. With this change the latter call is avoided. Previously last modification fetched the whole object and didn't use the metadata. This cause a lot of unnecessary traffic and thus making collectstatic slow.
Is there any chance we can move this issue forward? :)
Does this work in a multi threaded environment or does the cache need a lock?
+1 for this PR, will really increase a speed of my deployment :)
@jschneier, from their docs cachetools are not thread-safe (https://cachetools.readthedocs.io/en/stable/)