[Fixed]-Why is Django Caching my static with django.views.static.serve?

4👍

The bottom line here, based on the data provided, seems to be that your browser is caching the media files. The recommended method to resolve this is super refreshing the pages in your browser. See ALL the comments on your post.

However, If you really do not want the media files to be cached you can simply set them constantly unique names. Like so.

 <link rel="stylesheet" type="text/css" href="/site_media/css/style.css?{% now "U" %}" />

Now every time the page is reloaded the filename will be a little bit different based on the unix timestamp, forcing the browser to reload it all the time.

Leave a comment