Search code examples
google-chromestatic-files

Browser caching static files?


When I use static files that are served by a backend(Django/Node). I noticed that even if I delete the static files from the backend static folder. The static icons or images will still display even after I restart the server as long as I am serving to the same localhost port.

For example I deleted the following html:

<link rel="shortcut icon" href="assets/images/favicon.png">

And the tab icon still displays as long as I serve to the same localhost:port.

  • Why is this happening?
  • And how do I disable it?

Solution

  • The browser caches static files. When testing, it's useful to disable the cache. In chrome, go to developer tools, click on the Network tab, then check "Disable cache".