How to use HTTP caching in nginx for html files? How to use HTTP caching in nginx for html files? nginx nginx

How to use HTTP caching in nginx for html files?


To get a good grasp on how HTTP caching works. It's a good idea to read that section of the RFC.

Instead of changing all the urls with every single release and breaking all bookmarks people may have made, you could give Entity Tag Cache Validators (or ETags) a try. You can have nginx create etags for your html files. Al you have to do to have nginx regenerate them is change the timestamp by touching all files you changed.

PS if you run a really really busy thing, and want to avoid the requests that ETags do for checking them. You can set a long expire date like you have for your other files and change the urls by appending ?randomstring to urls, like is explained in Cache busting via params