首页 > 解决方案 > 如何在 IIS 10 和 ASP Clasic 上添加 Etag 和 Last Modified Header?

问题描述

如何使用 ASP Clasic 页面在 IIS 10 上添加 Last modified Headers 和 Last Modified 标头?

如果我检查例如 test.html IIS 10 的标头给我这个响应

Accept-Ranges: none
Content-Length: 16
Content-Type: text/html
Date: Wed, 11 Nov 2020 12:57:15 GMT
ETag: "5895395521b8d61:0"
Last-Modified: Wed, 11 Nov 2020 11:53:55 GMT
Server: Microsoft-IIS/10.0
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Frame-Option: deny
X-Powered-By: ASP.NET

但是,如果我们检查 test.asp IIS 的标头,请给我这个响应标头

Cache-Control: private
Content-Length: 149
Content-Type: text/html
Date: Wed, 11 Nov 2020 12:53:54 GMT
Server: Microsoft-IIS/10.0
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Frame-Option: deny
X-Powered-By: ASP.NET

我检查了 IIS 上的 HTTP 响应标头部分没有定义任何标头,并且使用 Enable Kernel Cache 选项启用了输出缓存。

标签: asp.netiis

解决方案


推荐阅读