I am using a combination of django-storages
and ManifestStaticFilesStorage
to server static files and media from S3
.
class StaticStorage(ManifestFilesMixin, S3BotoStorage):
location = settings.STATICFILES_LOCATION
When I run collectstatic
I can see the newest version of my JS
file on S3 with the correct timestamp.
I can also see that file being referenced in the staticfiles.json
manifest.
However looking at the site in the browser I am still seeing the old JS
being pulled down, not the one in the manifest
What could be going wrong?
The staticfiles.json
seems to be loaded once when the server starts up (from the S3 instance). If you run collectstatic
while the server is running it has no way of knowing that there were changes made to S3. You need to restart the server after running collectstatic
if changes have been made.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With