How do I force NGINX to load new static files?

Solution 1:

Have you tried manually deleting everything that is in your cache? This is typically /var/cache/nginx.

I believe that having add_header Cache-Control no-cache; set should keep things from being cached, but perhaps you have something that was cached in there before you set that?

Solution 2:

Setting expires -1; inside of a location block will actually disable caching completely.


Solution 3:

You are ignoring the cache of your readers browser. Unless you change the name of your objects (eg. add a version number to the .js), or the objects were sent with an ETag or Modification-Date, the browser may consider his version of the object is still valid for a couple of decennia, and never consult your server.

Tags:

Nginx

Cache