如何强制浏览器刷新网页的缓存版本 [英] How to force a browser to refresh a cached version of a webpage

查看:70
本文介绍了如何强制浏览器刷新网页的缓存版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,由于准备不充分的 apache conf 文件指示用户在未来几年缓存网站 URL.因此,当一个人访问该站点时,他们通常甚至不会尝试请求该页面.浏览器只是从缓存中加载 HTML.

I have a website that because of an ill-prepared apache conf file has instructed users to cache a website URL several years into the future. As a result, when a person visits the site, they often make no attempt to even request the page. The browser just loads the HTML from cache.

本网站即将进行重大更新,我希望用户能够看到它.有没有办法强迫用户实际重新请求网页?我担心对于某些用户来说,除非他们碰巧按 F5,否则他们可能会看到几年的旧网页.

This website is about to get a major update, and I would like for users to be able to see it. Is there a way for me to force a user to actually re-request the webpage? I fear that for some users, unless they happen to press F5, they may see the old webpage for several years.

推荐答案

使用不同的 URL.如果您网站的主要入口点(如主索引文件)被缓存,那么您就完蛋了……也许您应该注册另一个域名?

Use different URLs. If the main entry point to your website (like the main index file) is cached, then you're screwed... maybe you should register another domain name?

这篇关于如何强制浏览器刷新网页的缓存版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆