开发者

expires max on Nginx

I have a few questions about this directive:

  • Is this what tells browser how often it should retrieve the file?
  • What's the recommended setting hours/days/max for this on site css/image files?
  • If I set this value to max, but then update some of the files on server, will user browsers not get the new files until they expire?
  • 开发者_StackOverflow社区


expires max; sets browser cache expiration time in far future (2030 year). So, you should use it with caution. You will not be able to say to client, that file was changed. But, you would be able to rename file or to add some query to file name (e.g. "/style/main.css?v=2").

Always exclude location "favicon.ico" from expires max. This location is hardcoded in most browsers, so you won't be able to rename or add version to this file. Set expires for favicon to 1-2 month.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜