强制浏览器使用本地缓存(cache-control/expires),不要和服务器通信?
2017-06-04 23:25
549 查看
nginx 可以这样配置。
nginx.conf 中
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
nginx.conf 中
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
相关文章推荐
- IE,FF客户端浏览器缓存机制 && 服务器设置的expires, Cache-Control,no-cache,no-store机制
- Google网络框架Volley的使用,Cache-Control=no-cache时强制缓存的处理
- 浏览器缓存相关的Http头介绍:Expires,Cache-Control,Last-Modified,ETag
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- 浏览器缓存相关的Http头介绍:Expires,Cache-Control,Last-Modified,ETag
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- 浏览器缓存相关的Http头介绍:Expires,Cache-Control,Last-Modified,ETag
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- centos6.5源码安装和centos7.2使用yum安装httpd后,如何添加模块;以及怎么设置Cache-Control:max-age=?浏览器缓存时间
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- 浏览器缓存相关的HTTP控制头(Last-Modified/Etag/Expires/Cache-Control)详解
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明
- 浏览器缓存及应用Cache-Control(用于本地缓存),Expires(用于本地缓存),Last-Modified(协商缓存),Etag(协商缓存)
- 浏览器缓存相关的HTTP头介绍:Expires,Cache-Control,Last-Modified,ETag
- 浏览器缓存相关的Http头介绍:Expires,Cache-Control,Last-Modi...
- 浏览器缓存详解:expires,cache-control,last-modified,etag详细说明