硬刷新网站设计
我正在开发一个网站,但每次我做一个小的更改时,我都必须执行硬刷新才能看到更改。
这里明显的问题是,用户可能永远不会进行硬刷新,因此他/她不会立即看到效果。另外,有时当我更改样式表时, 如果没有硬刷新,网站看起来会很混乱。
我能做些什么?
I am developing a site, but every time I do a small change I have to perform a hard refresh in order to see the change.
The obvious question here is that a user probably will never do a hard refresh, and so he/she will not see the effects immediately. Plus, sometimes when I change the stylesheet,
without hard refresh the site looks like a mess.
What can I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过添加缓存控制元标记来强制页面不缓存:
您还可以通过添加版本获取参数来防止缓存样式表:
增加版本号以强制加载新版本。
You can force the page not to cache by adding cache control meta tags:
You can also prevent caching of your stylesheet by adding a version get parameter:
Increment the version number to force a new version to be loaded.
那么,您的设计中的更改(外部样式表?)没有立即显示出来?
这可能与浏览器缓存有关。
您的文件已被缓存,这是一件好事。如果您想使缓存无效,您可以向外部文件添加一个参数,如下所示:
这个很棒的软件的开发人员都知道这一点。
So, the changes in your design (external stylesheets?) are not immediately showing?
This probably has to do with the browser cache.
Your files are cached, which is a good thing. If you want to invalidate the cache, you might add a parameter to your external files, like this:
The developers of this awesome piece of software know all about this.