回答
收藏
分享
举报
Cache-Control配置问题
提问于2021-06-01 21:34

浏览 789

文章标签

Cache-Control设置了max-age没有覆盖no-cache,no-store,响应头出现三个Cahce-control

已修改于2023-03-15 02:13



写下您的回答
发表回答
全部回答(1)

按点赞数排序

按时间排序

请提供详细配置信息。
location / {
add_header Cache-Control max-age=2592000;
root html;
index index.html index.htm;
}
我使用如上配置,服务端响应如下:
HTTP/1.1 200 OK
Server: nginx/1.20.2
Date: Fri, 02 Sep 2022 09:10:55 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Wed, 20 Jul 2022 12:09:37 GMT
Connection: keep-alive
ETag: "62d7f081-264"
Cache-Control: max-age=2592000
Accept-Ranges: bytes

<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>

赞同

0

回复举报

回答于2022-10-25 15:25



回复为什么不ban猛犸
回复
提问者
sm9417
这家伙很懒还未留下介绍~
0
文章
1
问答
0
粉丝
相关问答

你应该有一个默认的服务器来捕捉所有的,你可以返回404或更好地不响应(会节省一些带宽),通过返回444它是nginx特定的HTTP响应,只需关闭连接并返回任何内容  

点赞 0
浏览 1.2k

try_files file ... =404; 可以指定找不到时,返回的消息码。 默认不指定找不到的话,会以最后的参数从新location 从定向。 

点赞 0
浏览 1.1k

求大佬解惑

点赞 0
浏览 713