asp生成html后,怎样阻止浏览器缓存html?

powerc1 2017-07-23 04:53:08
我的程序每隔15分钟就用ASP生成一次html文件,如test.html,怎样阻止浏览器在刷新这个被生成的test.html文件时不去读取缓存文件,而去读取服务器上的最新生成文件?
...全文
193 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Go 旅城通票 2017-07-26
  • 打赏
  • 举报
回复
引用 6 楼 powerc1 的回复:
[quote=引用 5 楼 showbo 的回复:] [quote=引用 4 楼 powerc1 的回复:] [quote=引用 3 楼 showbo 的回复:] <head> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Expires" content="0" /> ...其他meta </head>
怎么好像有时有效果,有时没有效果?[/quote]加这个头不一定有用,和浏览器有关,如果做了cdn加速还和加速节点更新频率有关[/quote] 那怎么保证绝对有用?没有做CDN方面的加速,能不能在服务器端禁止指定的文件缓存?[/quote] 没有绝对的,是否读取缓存依赖浏览器,你加这个头只要f5刷新都可以获取到最新的内容,那种粘贴地址到浏览器回车那种一般加载过都是读缓存的
powerc1 2017-07-26
  • 打赏
  • 举报
回复
引用 5 楼 showbo 的回复:
[quote=引用 4 楼 powerc1 的回复:] [quote=引用 3 楼 showbo 的回复:] <head> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Expires" content="0" /> ...其他meta </head>
怎么好像有时有效果,有时没有效果?[/quote]加这个头不一定有用,和浏览器有关,如果做了cdn加速还和加速节点更新频率有关[/quote] 那怎么保证绝对有用?没有做CDN方面的加速,能不能在服务器端禁止指定的文件缓存?
Go 旅城通票 2017-07-25
  • 打赏
  • 举报
回复
引用 4 楼 powerc1 的回复:
[quote=引用 3 楼 showbo 的回复:] <head> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Expires" content="0" /> ...其他meta </head>
怎么好像有时有效果,有时没有效果?[/quote]加这个头不一定有用,和浏览器有关,如果做了cdn加速还和加速节点更新频率有关
powerc1 2017-07-25
  • 打赏
  • 举报
回复
引用 3 楼 showbo 的回复:
<head> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Expires" content="0" /> ...其他meta </head>
怎么好像有时有效果,有时没有效果?
Go 旅城通票 2017-07-24
  • 打赏
  • 举报
回复
<head> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv="Expires" content="0" /> ...其他meta </head>
powerc1 2017-07-23
  • 打赏
  • 举报
回复
引用 1 楼 ccppvv 的回复:
HTML中加一个meta 设置 Cache-Control : no-cache,Progma:no-cache,Expires : new Date() 合理的设置缓存时间。或者在链接后面加一个时间戳,它就不会读取上次的缓存了。而是重新发起请求。
请完完整些,是这样吗? <meta Cache-Control : no-cache,Progma:no-cache,Expires : new Date()>
小伙真帅 2017-07-23
  • 打赏
  • 举报
回复
HTML中加一个meta 设置 Cache-Control : no-cache,Progma:no-cache,Expires : new Date() 合理的设置缓存时间。或者在链接后面加一个时间戳,它就不会读取上次的缓存了。而是重新发起请求。

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧