We have configured nginx server to add cache control header to public and expiration time to 1 month.
But when we make a request from browser, client is adding Cache-Control: no-cache
header. Because of this everytime, it is downloading the content fresh instead of serving the cached version.
How can I make to cache static files?
If I fire the request from terminal, Cache-Control
header added by server is visible in response headers.
You probably have the Disable cache (while DevTools is open)
option selected in the Preferences panel of DevTools.
It's very easy to forget about it! that's what happened to me anyway. Uncheck the option and try again.