Nginx prevents cache booting

I update my site often after the updates are completed, when my clients report that old images and scripts are loading instead of new ones. I know that they come from the browser cache, but is there a way to make the scripts not load from the cache on the server.

I am using nginx with php-fpm.

+5
source share
1 answer

You can force HTTP headers to influence browser caching behavior, however this is probably not a good idea in a production environment where you want to cache.

So just use something like:

expires -1

To force the title Cache-Control no-cache

More details here:

http://wiki.nginx.org/HttpHeadersModule

, , . , CDN, . , , (.. - ). :

someimagev1.jpg
someimagev2.jpg
somejs1.js
somejs2.js
etc.

( HTML) .

+11

All Articles