collectstatic content hash

47 views
Skip to first unread message

1337 Shadow Hacker

unread,
Jul 12, 2020, 11:57:46 PM7/12/20
to Django developers (Contributions to Django itself)
Currently, if yourscript.js is served with {% static 'yourscript.js' %}, you open the page in your browser, then change some HTML and yourscript.js and redeploy, reload the page without refreshing browser cache manually then you will see the new HTML with the old version of yourscript.js.

This seems to be a problem that collectstatic and {% static %} could solve:

1. collectstatic adds the script content has in the filename of the file it copies
2. collectstatic removes the previous version from the static root, if any
3. {% static %} will find the right file name with the content hash (there should only be one thanks to 2.)

What do you think ?

1337 Shadow Hacker

unread,
Jul 13, 2020, 12:20:29 AM7/13/20
to Django developers (Contributions to Django itself)
Reply all
Reply to author
Forward
0 new messages