Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome is sending Cache-control:no-cache header

We have configured nginx server to add cache control header to public and expiration time to 1month. But when we make a request from brower, 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.

Check the below screenshots : enter image description here enter image description here

like image 579
Rajeev Avatar asked Mar 10 '17 13:03

Rajeev


2 Answers

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.

like image 85
Juan Hernandez Avatar answered Nov 13 '22 00:11

Juan Hernandez


I want to add to the accepted answer that refreshing with CMD-SHIFT-R on a Mac or CTRL-SHIFT-R on Windows will also send Cache-Control: no-cache.

like image 33
David Hansen Avatar answered Nov 13 '22 02:11

David Hansen