Nginx 配置之开启缓存过期时间

Nginx 缓存 About 379 words

expires

默认单位:秒。

  • h:时
  • m:分
  • s:秒
  • y:年
location ~ .*\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm)$ {
    expires      1m;
}

location ~ .*\.(?:js|css)$ {
    expires      1;
}

location ~ .*\.(?:eot|ttf|woff|woff2)$ {
    expires      1y;
}

location ~ .*\.(?:html|htm)$ {
    add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
Views: 3,876 · Posted: 2019-03-20

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh