如何让用户在加载网站时重新获得网站(清除缓存)? [英] How do make a user re-aqcuire the website (clear cache) when loading it?

查看:169
本文介绍了如何让用户在加载网站时重新获得网站(清除缓存)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我是初学者,并在github上创建一个基本网站供我和一些朋友不时使用,但我偶尔会在可靠性和设计改进方面推动更新,但由于github只承载你的内容index.html,没有其他任何东西,没有自动缓存清理等等,这就是你所说的预制网站。



我该如何做到这一点,每当我推送更新时,我们不必执行CTRL + F5来清除缓存和重新加载页面?



在一个index.html文件中执行此操作。



谢谢。



我尝试了什么:



在线查看一些解决方案,似乎都在javascript或C ++环境..

So I'm a beginner and make a basic website hosted on github for just me and some friends to use time to time, but I occassionally push updates in terms of reliability and design improvements, but since github only hosts what's in your index.html and nothing else, there's no automated cache clearing and such, which is what you would see from say a prebuilt website with weebly.

How do I do this so that whenever I push an update we don't have to do CTRL + F5 to clear cache and reload page?

Doing this in an index.html file btw.

Thanks.

What I have tried:

Looked some solutions up online, all seem to be in a javascript or C++ environment..

推荐答案

谷歌的html no cache header,你会发现你所需要的一切。



您无法在页面加载时清除浏览器的缓存。您只能控制您发送的页面的缓存策略。
Google for "html no cache header" and you'll find all you need.

You cannot clear the cache of the browser on page load. You can only control the caching policy of the page you send.


这篇关于如何让用户在加载网站时重新获得网站(清除缓存)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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