当前位置: 首页 > news >正文

IIS HTML, CSS, Script, 图片等静态文件不更新问题

文件已经更新到站点,但客户端访问仍然没有更新,主要是各种静态文件。
网关代理服务器缓存的可能性比较大,应该先检查这个原因。
代理服务器缓存还有一些其它表现,本地访问可以看到更新的效果;同一个网段、IE设置局域网访问不走代理,也能看到更新效果;客户端直接使用url访问静态文件(html页面、css文件、脚本等),获取到的是未更新的,在服务器上更新文件名字,客户端使用新的文件名访问,能够获取到更新后的文件。


Tag Name Example(s) Description
Author <META NAME="AUTHOR" CONTENT="Tex Texin"> The author's name.
cache-control <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> HTTP 1.1. Allowed values = PUBLIC | PRIVATE | NO-CACHE | NO-STORE.
Public - may be cached in public shared caches
Private - may only be cached in private cache
no-Cache - may not be cached
no-Store - may be cached but not archived

The directive CACHE-CONTROL:NO-CACHE indicates cached information should not be used and instead requests should be forwarded to the origin server. This directive has the same semantics as the PRAGMA:NO-CACHE.
Clients SHOULD include both PRAGMA:NO-CACHE and CACHE-CONTROL:NO-CACHE when a no-cache request is sent to a server not known to be HTTP/1.1 compliant.
Also see EXPIRES.
Note: It may be better to specify cache commands in HTTP than in META statements, where they can influence more than the browser, but proxies and other intermediaries that may cache information.

Content-Language <META HTTP-EQUIV="CONTENT-LANGUAGE"
CONTENT="en-US,fr">
Declares the primary natural language(s) of the document. May be used by search engines to categorize by language.
CONTENT-TYPE <META HTTP-EQUIV="CONTENT-TYPE"
CONTENT="text/html; charset=UTF-8">
The HTTP content type may be extended to give the character set. It is recommended to always use this tag and to specify the charset.
Copyright <META NAME="COPYRIGHT" CONTENT="&copy; 2004 Tex Texin"> A copyright statement.
DESCRIPTION <META NAME="DESCRIPTION"
CONTENT="...summary of web page...">
The text can be used when printing a summary of the document. The text should not contain any formatting information. Used by some search engines to describe your document. Particularly important if your document has very little text, is a frameset, or has extensive scripts at the top.
EXPIRES <META HTTP-EQUIV="EXPIRES"
CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">
The date and time after which the document should be considered expired. An illegal EXPIRES date, e.g. "0", is interpreted as "now". Setting EXPIRES to 0 may thus be used to force a modification check at each visit.
Web robots may delete expired documents from a search engine, or schedule a revisit.

HTTP 1.1 (RFC 2068) specifies that all HTTP date/time stamps MUST be generated in Greenwich Mean Time (GMT) and in RFC 1123 format.
RFC 1123 format = wkday "," SP date SP time SP "GMT"

wkday = (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
date = 2DIGIT SP month SP 4DIGIT ; day month year (e.g., 02 Jun 1982)
time = 2DIGIT ":" 2DIGIT ":" 2DIGIT ; 00:00:00 - 23:59:59
month = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)

Keywords <META NAME="KEYWORDS"
CONTENT="sex, drugs, rock & roll">
The keywords are used by some search engines to index your document in addition to words from the title and document body. Typically used for synonyms and alternates of title words. Consider adding frequent misspellings. e.g. heirarchy, hierarchy.
PRAGMA NO-CACHE <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> This directive indicates cached information should not be used and instead requests should be forwarded to the origin server. This directive has the same semantics as the CACHE-CONTROL:NO-CACHE directive and is provided for backwards compatibility with HTTP/1.0.
Clients SHOULD include both PRAGMA:NO-CACHE and CACHE-CONTROL:NO-CACHE when a no-cache request is sent to a server not known to be HTTP/1.1 compliant.
HTTP/1.1 clients SHOULD NOT send the PRAGMA request-header. HTTP/1.1 caches SHOULD treat "PRAGMA:NO-CACHE" as if the client had sent "CACHE-CONTROL:NO-CACHE".
Also see EXPIRES.
Refresh <META HTTP-EQUIV="REFRESH"
CONTENT="15;URL=http://www.I18nGuy.com/index.html">
Specifies a delay in seconds before the browser automatically reloads the document. Optionally, specifies an alternative URL to load, making this command useful for redirecting browsers to other pages.
ROBOTS <META NAME="ROBOTS" CONTENT="ALL">

<META NAME="ROBOTS" CONTENT="INDEX,NOFOLLOW">

<META NAME="ROBOTS" CONTENT="NOINDEX,FOLLOW">

<META NAME="ROBOTS" CONTENT="NONE">
CONTENT="ALL | NONE | NOINDEX | INDEX| NOFOLLOW | FOLLOW | NOARCHIVE"
default = empty = "ALL"
"NONE" = "NOINDEX, NOFOLLOW"

The CONTENT field is a comma separated list:
INDEX: search engine robots should include this page.
FOLLOW: robots should follow links from this page to other pages.
NOINDEX: links can be explored, although the page is not indexed.
NOFOLLOW: the page can be indexed, but no links are explored.
NONE: robots can ignore the page.
NOARCHIVE: Google uses this to prevent archiving of the page. See http://www.google.com/bot.html

GOOGLEBOT <META NAME="GOOGLEBOT" CONTENT="NOARCHIVE"> In addition to the ROBOTS META Command above, Google supports a GOOGLEBOT command. With it, you can tell Google that you do not want the page archived, but allow other search engines to do so. If you specify this command, Google will not save the page and the page will be unavailable via its cache.
See Google's FAQ.

转载于:https://www.cnblogs.com/RicCC/archive/2007/10/23/cache-about-static-files.html

相关文章:

  • firefox 中对 select option 操作
  • MSDN上终于有了Tester Center
  • 如何独立设计完成一个软件项目
  • AIX下的系统管理工具-SMIT
  • 制作无盘xp
  • IIS 7.0探索用于 Windows Vista 的 Web 服务器和更多内容
  • 陈安之:成功者都运用“潜意识”的力量
  • 知识生态系统”二三事
  • SQL安全 建议
  • 用不用刀片?三个方面确定答案
  • PXA27X睡眠唤醒问题
  • 贝克汉姆Adidas广告词
  • PIX防火墙(续)
  • MSDN Webcast - 模式与实践系列课程预告
  • table-表格
  • ----------
  • JavaScript-如何实现克隆(clone)函数
  • [分享]iOS开发-关于在xcode中引用文件夹右边出现问号的解决办法
  • 【刷算法】求1+2+3+...+n
  • CSS进阶篇--用CSS开启硬件加速来提高网站性能
  • CSS实用技巧
  • MySQL QA
  • Python学习之路13-记分
  • Python中eval与exec的使用及区别
  • SpiderData 2019年2月13日 DApp数据排行榜
  • 高度不固定时垂直居中
  • 京东美团研发面经
  • 聊聊spring cloud的LoadBalancerAutoConfiguration
  • 如何编写一个可升级的智能合约
  • 深入浅出Node.js
  • 微信小程序上拉加载:onReachBottom详解+设置触发距离
  • 再次简单明了总结flex布局,一看就懂...
  • ​Base64转换成图片,android studio build乱码,找不到okio.ByteString接腾讯人脸识别
  • # 深度解析 Socket 与 WebSocket:原理、区别与应用
  • #gStore-weekly | gStore最新版本1.0之三角形计数函数的使用
  • #我与Java虚拟机的故事#连载13:有这本书就够了
  • $().each和$.each的区别
  • (04)odoo视图操作
  • (145)光线追踪距离场柔和阴影
  • (javascript)再说document.body.scrollTop的使用问题
  • (WSI分类)WSI分类文献小综述 2024
  • (第9篇)大数据的的超级应用——数据挖掘-推荐系统
  • (二十一)devops持续集成开发——使用jenkins的Docker Pipeline插件完成docker项目的pipeline流水线发布
  • (附源码)springboot人体健康检测微信小程序 毕业设计 012142
  • (三)模仿学习-Action数据的模仿
  • (十二)devops持续集成开发——jenkins的全局工具配置之sonar qube环境安装及配置
  • (四)docker:为mysql和java jar运行环境创建同一网络,容器互联
  • (学习日记)2024.03.12:UCOSIII第十四节:时基列表
  • (转)ObjectiveC 深浅拷贝学习
  • (轉貼) 寄發紅帖基本原則(教育部禮儀司頒布) (雜項)
  • (自适应手机端)响应式新闻博客知识类pbootcms网站模板 自媒体运营博客网站源码下载
  • .NET “底层”异步编程模式——异步编程模型(Asynchronous Programming Model,APM)...
  • .NET Micro Framework初体验(二)
  • .NET/C# 的字符串暂存池
  • .NET学习全景图