- 浏览: 493296 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (563)
- 工作经验 (12)
- 数据库 (13)
- Servlet (10)
- Struts2 (1)
- Spring (25)
- Eclipse (5)
- Hibernate (5)
- Eclips (8)
- HTTP (7)
- J2EE (21)
- EHcache (1)
- HTML (11)
- 工具插件使用 (20)
- JPA (2)
- 杂谈 (17)
- 数据结构与算法 (3)
- Cloud Foundry (1)
- 安全 (10)
- J2SE (57)
- SQL (9)
- DB2 (6)
- 操作系统 (2)
- 设计模式 (1)
- 版本代码管理工具 (13)
- 面试 (10)
- 代码规范 (3)
- Tomcat (12)
- Ajax (5)
- 异常总结 (11)
- REST (2)
- 云 (2)
- RMI (3)
- SOA (1)
- Oracle (12)
- Javascript (20)
- jquery (7)
- JSP自定义标签 (2)
- 电脑知识 (5)
- 浏览器 (3)
- 正则表达式 (3)
- 建站解决问题 (38)
- 数据库设计 (3)
- git (16)
- log4j (1)
- 每天100行代码 (1)
- socket (0)
- java设计模式 耿祥义著 (0)
- Maven (14)
- ibatis (7)
- bug整理 (2)
- 邮件服务器 (8)
- Linux (32)
- TCP/IP协议 (5)
- java多线程并发 (7)
- IO (1)
- 网页小工具 (2)
- Flash (2)
- 爬虫 (1)
- CSS (6)
- JSON (1)
- 触发器 (1)
- java并发 (12)
- ajaxfileupload (1)
- js验证 (1)
- discuz (2)
- Mysql (14)
- jvm (2)
- MyBatis (10)
- POI (1)
- 金融 (1)
- VMWare (0)
- Redis (4)
- 性能测试 (2)
- PostgreSQL (1)
- 分布式 (2)
- Easy UI (1)
- C (1)
- 加密 (6)
- Node.js (1)
- 事务 (2)
- zookeeper (3)
- Spring MVC (2)
- 动态代理 (3)
- 日志 (2)
- 微信公众号 (2)
- IDEA (1)
- 保存他人遇到的问题 (1)
- webservice (11)
- memcached (3)
- nginx (6)
- 抓包 (1)
- java规范 (1)
- dubbo (3)
- xwiki (1)
- quartz (2)
- 数字证书 (1)
- spi (1)
- 学习编程 (6)
- dom4j (1)
- 计算机系统知识 (2)
- JAVA系统知识 (1)
- rpcf (1)
- 单元测试 (2)
- php (1)
- 内存泄漏cpu100%outofmemery (5)
- zero_copy (2)
- mac (3)
- hive (3)
- 分享资料整理 (0)
- 计算机网络 (1)
- 编写操作系统 (1)
- springboot (1)
最新评论
-
masuweng:
亦论一次OutOfMemoryError的定位与解错 -
变脸小伙:
引用[color=red][/color]百度推广中运用的技术 ...
Spring 3 mvc中返回pdf,json,xml等不同的view -
Vanillva:
不同之处是什么??
Mybatis中的like查询 -
thrillerzw:
转了。做个有理想的程序员
有理想的程序员必须知道的15件事 -
liujunhui1988:
觉得很有概括力
15 个必须知道的 Java 面试问题(2年工作经验)
源:http://nginx.org/en/docs/http/ngx_http_headers_module.html
评:
add_header Cache-Control public;
Module ngx_http_headers_module
Example Configuration
Directives
add_header
expires
The ngx_http_headers_module module allows adding the “Expires” and “Cache-Control” header fields, and arbitrary fields, to a response header.
Example Configuration
expires 24h;
expires modified +24h;
expires @24h;
expires 0;
expires -1;
expires epoch;
add_header Cache-Control private;
Directives
Syntax: add_header name value [always];
Default: —
Context: http, server, location, if in location
Adds the specified field to a response header provided that the response code equals 200, 201, 204, 206, 301, 302, 303, 304, or 307. A value can contain variables.
There could be several add_header directives. These directives are inherited from the previous level if and only if there are no add_header directives defined on the current level.
If the always parameter is specified (1.7.5), the header field will be added regardless of the response code.
Syntax: expires [modified] time;
expires epoch | max | off;
Default:
expires off;
Context: http, server, location, if in location
Enables or disables adding or modifying the “Expires” and “Cache-Control” response header fields provided that the response code equals 200, 201, 204, 206, 301, 302, 303, 304, or 307. A parameter can be a positive or negative time.
A time in the “Expires” field is computed as a sum of the current time and time specified in the directive. If the modified parameter is used (0.7.0, 0.6.32) then time is computed as a sum of the file’s modification time and time specified in the directive.
In addition, it is possible to specify a time of the day using the “@” prefix (0.7.9, 0.6.34):
expires @15h30m;
The epoch parameter corresponds to the absolute time “Thu, 01 Jan 1970 00:00:01 GMT”. The contents of the “Cache-Control” field depends on the sign of the specified time:
time is negative — “Cache-Control: no-cache”.
time is positive or zero — “Cache-Control: max-age=t”, where t is a time specified in the directive, in seconds.
The max parameter sets “Expires” to the value “Thu, 31 Dec 2037 23:55:55 GMT”, and “Cache-Control” to 10 years.
The off parameter disables adding or modifying the “Expires” and “Cache-Control” response header fields.
评:
add_header Cache-Control public;
Module ngx_http_headers_module
Example Configuration
Directives
add_header
expires
The ngx_http_headers_module module allows adding the “Expires” and “Cache-Control” header fields, and arbitrary fields, to a response header.
Example Configuration
expires 24h;
expires modified +24h;
expires @24h;
expires 0;
expires -1;
expires epoch;
add_header Cache-Control private;
Directives
Syntax: add_header name value [always];
Default: —
Context: http, server, location, if in location
Adds the specified field to a response header provided that the response code equals 200, 201, 204, 206, 301, 302, 303, 304, or 307. A value can contain variables.
There could be several add_header directives. These directives are inherited from the previous level if and only if there are no add_header directives defined on the current level.
If the always parameter is specified (1.7.5), the header field will be added regardless of the response code.
Syntax: expires [modified] time;
expires epoch | max | off;
Default:
expires off;
Context: http, server, location, if in location
Enables or disables adding or modifying the “Expires” and “Cache-Control” response header fields provided that the response code equals 200, 201, 204, 206, 301, 302, 303, 304, or 307. A parameter can be a positive or negative time.
A time in the “Expires” field is computed as a sum of the current time and time specified in the directive. If the modified parameter is used (0.7.0, 0.6.32) then time is computed as a sum of the file’s modification time and time specified in the directive.
In addition, it is possible to specify a time of the day using the “@” prefix (0.7.9, 0.6.34):
expires @15h30m;
The epoch parameter corresponds to the absolute time “Thu, 01 Jan 1970 00:00:01 GMT”. The contents of the “Cache-Control” field depends on the sign of the specified time:
time is negative — “Cache-Control: no-cache”.
time is positive or zero — “Cache-Control: max-age=t”, where t is a time specified in the directive, in seconds.
The max parameter sets “Expires” to the value “Thu, 31 Dec 2037 23:55:55 GMT”, and “Cache-Control” to 10 years.
The off parameter disables adding or modifying the “Expires” and “Cache-Control” response header fields.
发表评论
-
Mysql经mysql连接的空闲时间超过8小时后 MySQL自动断开该连接解决方案
2016-07-06 17:16 2090源:http://www.jb51.net/artic ... -
Shell script: 获取第10+个参数
2015-11-04 14:33 437源:http://www.cnblogs.com/sheldo ... -
no server suitable for synchronization found
2015-10-21 16:15 977源:http://blog.sina.com.cn/s/blo ... -
nginx超时设置
2015-10-21 14:15 669源:http://www.cnblogs.com/discus ... -
ssh 免密码登录
2015-10-12 11:26 389源:http://chenlb.iteye.com/blog/ ... -
Maven Release Plugin Prepare a Release and create new branch
2015-09-17 15:22 766源:http://maven.apache.org/maven ... -
Centos初始化java环境
2015-09-12 14:31 4641.上传 jdk jdk-7u65-linux-x64.tar ... -
ssh 远程不能执行JAVA启动脚本
2015-09-08 21:17 1252源:http://java.freesion.com/arti ... -
java ImageIO处理图像的封装
2015-09-06 10:17 340源:http://blog.csdn.net/hu_sheng ... -
[install_docs] Error 1
2015-08-22 16:49 366源:http://zhidao.baidu.com/link? ... -
解决eclipse显示jar源代码中文乱码问题
2015-08-07 16:47 540源:http://wmljava.iteye.com/blog ... -
超漂亮的纯JAVA浏览器(附源码)
2015-08-06 16:42 1173源:http://blog.csdn.net/lxf9601/ ... -
https单向加密与双向加密区别
2015-05-23 11:04 2000源:http://edison0663.iteye.c ... -
使用nginx搭建https服务器
2015-05-19 17:42 1031源:http://www.cnblogs.com/ti ... -
quartz的任务调度,同一个任务,在相同的时间被调用了2次
2015-02-11 13:06 596源:http://www.iteye.com/topi ... -
目前常用命令
2015-02-09 20:14 576JSON格式化 http://json.parse ... -
CentOS 中yum命令运行错误解决办法
2015-02-03 14:10 640源:http://blog.sina.com.cn/s/blo ... -
[转]漫谈创业和管理-程序员5大思维障碍
2015-01-29 20:09 650源:http://javatar.iteye.com/blog ... -
win8 如何命令行设置 计划任务
2014-12-18 18:35 811源:http://zhidao.baidu.com/link? ... -
Nginx配置proxy_pass
2014-11-30 23:13 553源:http://dmouse.iteye.com/blog/ ...
相关推荐
Dokku Nginx 缓存 在 Nginx 的代理缓存指令中连线。 用测试。 您的里程可能因香草 Dokku 而异。... X-Accel-Expires 、 Expires 、 Cache-Control 、 Set-Cookie和Vary设置响应的参数; X-Accel-Redirect执行到指定
time值还控制”Cache-Control”的值:负数表示no-cache正数或零表示max-age=time epoch:指定“Expires”的值为 1January,1970,00:00:01 GMTmax:指定“Expires”的值为31December2037 23:59:59G
ngx_http_headers_module模块提供了两个重要的指令add_header和expires,来添加 “Expires” 和 “Cache-Control” 头字段,对响应头添加任何域字段。add_header可以用来标示请求访问到哪台服务器上,这个也可以通过...
nginx.conf 部分内容: proxy_temp_path /nginx/cache/temp; proxy_cache_path /nginx/cache/path levels=1:2 keys_zone=cache_test:2048m ... proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-
浏览器之HTTP缓存的那些事 什么是浏览器缓存 浏览器HTTP执行机制 缓存模式 缓存相关的Http Header Cache-Control Expires Last-Modified ETag
header主要有如下: 代码如下:Cache-control:no-cache、no-store如果出现这两值,nginx缓存服务器是绝对不会缓存的 代码如下:Expires:1980-01-01如果出现日期比当前时间早,也不会缓存。 2. 解决不缓存方案 2.1 ...
受启发, fastify-disablecache插件设置以下响应标头和值以禁用客户端缓存: Surrogate-Control: no-store Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate Pragma: no-cache Expires: 0 您...
nginx可以通过 expires 指令来设置浏览器的Header 语法: expires [time|epoch|max|off] 默认值: expires off 作用域: http, server, location 使用本指令可以控制HTTP应答中的“Expires”和“Cache-Control”的头...
这篇教程说明你应该怎样配置 nginx、设置 HTTP 头部过期时间,用 Cache-Control 中的 max-age 标记为静态文件(比如图片、 CSS 和 Javascript 文件)设置一个时间,这样用户的浏览器就会缓存这些文件。这样能节省...
directory and run tattoo使用Fast-CGI配置Nginx(快速CGI) 将以下代码添加到您的nginx站点配置文件中以使其工作: location /static/ {expires 1d;root YOUR_BLOG_PATH;add_header Cache-Control must-revalidate;...