Currently have a project deployed on Heroku with static files loaded from S3. I'm using boto/django-storage to manage my S3 content, but if I call the same view or load the same page repeatedly, all the images/static content load twice and is not cached.
I've placed
AWS_HEADERS = {
'Cache-Control': 'max-age=2592000',
}
in my settings.py
, but the reason seems the same exact images (refreshed + loaded twice) have different signatures in their URL? I've tried multiples headers, but the browser doesn't seem want to cache it and instead loads them all everytime.
try setting
AWS_QUERYSTRING_AUTH = False
. Then the URL generated will always be the same (public) URL. The default-ACL inS3BotoStorage
ispublic-read
, which shouldn't be changed then.Two things not to forget:
public, max-age=XXX
, so public proxies also can cache your content?S3BotoStorage
combined with the Django-CachedStaticFilesStorage
(see here, but I use it without the seperate cache-backend)