/usr/local/nginx/conf/vhosts/yum.qr.cntv.net.conf
关闭前:
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/xml
Date: Wed, 18 Sep 2019 02:23:28 GMT
ETag: W/"5d80ad08-bb9" 【】
ip_network: 234.253
Last-Modified: Tue, 17 Sep 2019 09:53:12 GMT
Server: nginx
Transfer-Encoding: chunked
Vary: Accept-Encoding
关闭后:
http://yum.qr.cntv.net/centos/6/x86_64/repodata/repomd.xml
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/xml
Date: Wed, 18 Sep 2019 02:18:51 GMT
ip_network: 234.254
Last-Modified: Tue, 17 Sep 2019 09:53:12 GMT
Server: nginx
Transfer-Encoding: chunked
Vary: Accept-Encoding
来自:http://nginx.org/en/docs/http/ngx_http_core_module.html
Syntax: etag on | off;
Default:
etag on;
Context: http, server, location
This directive appeared in version 1.3.3.
二)关闭 if_modified_since off;的方法。
默认是开启的
可以参考两个方案(实践没有成功)
第一在nginx.conf里设置
if_modified_since off|on;
第二在具体的location段里
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
# add_header Last-Modified $date_gmt;
# add_header Last-Modified ""; #不想要就置空
# add_header Cache-Control "public";
}
PS:$date_gmt是内嵌变量,具体参考ngx_http_ssi_module模块
nginx如果打开了SSI模块,会默认关闭header中的last-modified输出
https://blog.csdn.net/weixin_34168700/article/details/92438695
关闭前:
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/xml
Date: Wed, 18 Sep 2019 02:23:28 GMT
ETag: W/"5d80ad08-bb9" 【】
ip_network: 234.253
Last-Modified: Tue, 17 Sep 2019 09:53:12 GMT
Server: nginx
Transfer-Encoding: chunked
Vary: Accept-Encoding
关闭后:
http://yum.qr.cntv.net/centos/6/x86_64/repodata/repomd.xml
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/xml
Date: Wed, 18 Sep 2019 02:18:51 GMT
ip_network: 234.254
Last-Modified: Tue, 17 Sep 2019 09:53:12 GMT
Server: nginx
Transfer-Encoding: chunked
Vary: Accept-Encoding
来自:http://nginx.org/en/docs/http/ngx_http_core_module.html
Syntax: etag on | off;
Default:
etag on;
Context: http, server, location
This directive appeared in version 1.3.3.
二)关闭 if_modified_since off;的方法。
默认是开启的
可以参考两个方案(实践没有成功)
第一在nginx.conf里设置
if_modified_since off|on;
第二在具体的location段里
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
# add_header Last-Modified $date_gmt;
# add_header Last-Modified ""; #不想要就置空
# add_header Cache-Control "public";
}
PS:$date_gmt是内嵌变量,具体参考ngx_http_ssi_module模块
nginx如果打开了SSI模块,会默认关闭header中的last-modified输出
https://blog.csdn.net/weixin_34168700/article/details/92438695
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/10295/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
评论列表