Django static files are not updated
django, django-caching, django-staticfiles, javascript
Solution
I often use `?v=00001` or any define number to force clear cache in browser. So in your case it could be:
<script src="{% static 'my_app/my_script.js?v=00001' %}"></script>
Or:
<script src="{% static 'my_app/my_script.js' %}?v=00001"></script>
Next time you change the script, increase the number to 00002. Of course there are many ways to do this but I still prefer this method.
Problem
In my Django project the application my_app has a template which references a javascript static file: ``` <script src="{% static 'my_app/my_script.js' %}"></script> ``` Once I installed my_script.js in my_app/templates/my_app, everything seemed to work. At some point I overwrote my_script.js with a different script, such that my_script.js has a different content now. However, when I load my_app with my browser, it loads the old my_script.js, although it does not exist anymore. How can I resolve it? Thanks.