1

I am using using ManifestStaticFilesStorage. After performing collectstatic and moving over the files to prod, I still see old css file (with old MD5 hash string) being fetched.

settings.py:

STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'

On prod, I can see staticfiles.json showing the correct (new) css file but still when I do 'view-source' from the web page, I can see old css being fetched.

What could I have missed?

Anupam
  • 14,950
  • 19
  • 67
  • 94

2 Answers2

3

Restart Django on prod after moving the files over.

(I don't know why that's required but thats the only thing that works)


Update (Aug 2022): I ran into the same problem after 5 years and bumped into my own post. This time restarting Django also did not help. But restarting Nginx helped (got the hint from @patrickm96's answer) - in case it helps

Anupam
  • 14,950
  • 19
  • 67
  • 94
  • 1
    I't because django caches content of the staticfiles.json file in memory during startup. It's used for quick lookup for hashed file name for every static file in `{% static %}` tag. – Dmitry P. Nov 12 '20 at 07:00
1

I had the same problem and restarting gunicorn helped me

patrikm96
  • 108
  • 3
  • 11