Nginx 配置之开启缓存过期时间
Nginx 缓存 大约 379 字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";
}
阅读 2219 · 发布于 2019-03-20
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
Linux uniq 命令简单使用阅读 2406
-
软考-系统架构设计师:物联网 IoT阅读 912
-
PHP 关闭 X-Powered-By 信息阅读 1020
-
MySQL 数据类型及占用字节数阅读 2556
-
MySQL 性能优化之 explain type 字段阅读 52
-
Linux 之 CentOS yum 安装 Nginx阅读 1754
-
k6 压测 HTTPS 接口报 X509 certificate signed by unknown authority阅读 562
-
OpenResty 返回中文乱码问题阅读 3507
-
Docker 容器与宿主机互相传输文件阅读 291
-
软考-系统架构设计师:处理流程设计阅读 1364