从浏览器中,如何使 Web 服务器刷新/使缓存的静态 html 网页失效?
问题:
今天,我们修改了客户网站中的静态 html 网页 - 我们添加了一些图像并修改了字体。并将文件通过 FTP 传输到客户端的 Web 服务器。 我们意识到我们在字体大小方面犯了一个错误,进行了更正,并再次通过 FTP 传输了该文件。
即使刷新了 100 次,网站也只显示我们第一次通过 FTP 传输的文件(字体错误)。
我们多次通过 FTP 传输了更正后的文件,但 Web 服务器仅提供带有错误字体的文件。
我们的猜测:
我们认为 Web 服务器缓存了我们第一次通过 FTP 传输的文件,并在后续请求时将其返回给我们,即使文件已更改。
我们尝试了以下技术(但没有成功):
- 我们向查询字符串添加了一个参数 (?R=33343545)
- 我们尝试了下面建议的技术 - 即发布到有问题的网页,但收到“405 方法不允许。HTTP不允许使用用于访问此页面的动词。” http://www.mnot.net/blog/2006/02/18/invalidation
请告知我们是否走在正确的道路上,以及在这种情况下我们是否可以尝试其他方法?
编辑:
我们想知道是否有一种方法(类似于上面的两种方法)可以仅从浏览器执行此操作......而不是触摸网络服务器上的设置。
PROBLEM:
Today, we modified a static html web page in a client's website -
we added a couple of images and modified the font. And FTPed the file to client's web server.
We realized we made a mistake with the font-size, corrected it, and FTPed the file again.
Even with a 100 refreshes, the website was displaying only the file (with wrong font) that we had FTPed the first time.
We FTPed the corrected file several times, but the file with the wrong font was the only file being served by the web server.
OUR GUESS:
We think that the web server cached the file that we had FTPed the first time, and is serving it back to us on subsequent requests even though the file had changed.
We tried the following techniques (but were unsuccessful):
- We added a parameter to the querystring (?R=33343545)
- We tried the technique suggested below - i.e. posting to the webpage in question, but got a "405 Method not allowed. The HTTP verb used to access this page is not allowed."
http://www.mnot.net/blog/2006/02/18/invalidation
Please advise if we were on the right path and if there is anything else that we can try in such situations ?
EDIT:
We would like to find out if there is a way (similar to the 2 methods above) to do it just from the browser..and not touch the settings on the webserver.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论