web建站教程
  1. 首页
  2. vuejs
  3. js
  4. 好玩
  5. seo教程
  6. 前端知识
  7. 百度echarts
  8. 更多
    php入门
    nodejs
    mockjs
    reactjs
    mysql
    wordpress
    织梦cms
    帝国cms
    git教程
    IT知识
    模板大全
    休息站

IIS配置如何设置缓存时间

608 ℃
     

如何在IIS配置中设置缓存时间,下面web建站小编给大家简单介绍一下具体实现步骤!

新增一个web.config文件,把下面需要的代码放到里面!

方法一:设置缓存时间365天

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
    </staticContent>
  </system.webServer>
</configuration>

方法二:设置某个文件的缓存时间365天

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <location path="style.css">
    <system.webServer>
      <staticContent>
        <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
      </staticContent>
    </system.webServer>
  </location>
</configuration>

方法三:设置缓存到指定时间

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <clientCache cacheControlMode="UseExpires" httpExpires="Sat, 31 May 2023 12:00:00 GMT" />
    </staticContent>
  </system.webServer>
</configuration>

iis配置导致php出现500.19错误是什么原因(附解决方法)

wordpress如何利用Windows+IIS配置伪静态方法

vue项目部署成功后刷新页面报404(解决方法)

iis环境安全测试报响应头缺失或不安全漏洞解决办法

appscan软件检测到隐藏目录漏洞IIS解决方法

标签: iis配置, 自动清除缓存, 设置缓存时间

上面是“IIS配置如何设置缓存时间”的全面内容,想了解更多关于 前端知识 内容,请继续关注web建站教程。

当前网址:https://ipkd.cn/webs_4454.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

当前位置: 网站首页 > 前端知识
本文共计790个字,预计阅读时长6分钟
生活小工具,收录了80多款小工具
上一篇: 推荐一款免费商用的斜体创意字体——字魂扁桃体
下一篇: 推荐一款充满古雅之风的免费字体——问藏书房字体
x 打工人ai神器