简体   繁体   中英

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 : 在此处输入图片说明 在此处输入图片说明

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.

我想添加到已接受的答案中,即在 Mac 上使用 CMD-SHIFT-R 刷新或在 Windows 上使用 CTRL-SHIFT-R 刷新也会发送Cache-Control: no-cache

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM