强制观众取消缓存css? [英] Forcing viewers to un-cache css?

查看:63
本文介绍了强制观众取消缓存css?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经更新了我的CSS,如果你查看主页面的旧css

缓存,它会破坏页面。有没有办法强制将

有旧的CSS缓存的观众都得到新的CSS?


我们的观众不精通技术,并止跌'吨知道什么是"硬刷新"。

为,也不在于它需要做

解决方案
< blockquote>

< hu ********* @ gmail.comwrote in message

news:11 *********** ***********@h48g2000cwc.googlegr oups.com ...


>我更新了我的CSS,如果你查看主要内容页面与旧的CSS

缓存,它打破了页面。是否有任何方法可以强迫观众将旧的css缓存以获得新的CSS?


我们的观众不懂科技,也不会'''知道什么是硬刷新

,也不需要它完成。



在头部使用元标记使页面到期。


< META http-equiv =" Expires" content =" Tue,1996年8月20日14:25:27 GMT">


" Mark F." < re ********* @ nospam.comwrites:


< hu ********* @ gmail.comwrote in消息

news:11 ********************** @ h48g2000cwc.googlegr oups.com ...


我已经更新了我的CSS,如果你查看主页面的旧css

缓存,它会破坏页面。是否有任何方法可以强迫观众将旧的css缓存以获得新的CSS?


我们的观众不懂科技,也不会'''知道什么是硬刷新

,也不需要它完成。


使用一个元标记的头部会到期的所述页面


将。META HTTP-当量= QUOT;到期" ; content =" Tue,1996年8月20日14:25:27 GMT">



无用 - 不会影响CSS文件,无论如何都会被任何

真正的HTTP标头覆盖。哦,当然,任何持有

页面的人卡在他们的缓存中都不会看到新版本。


最好的解决方案是将新的CSS文件复制到新的文件名,然后将
更改为指向新的CSS。然后他们应该使用旧的CSS +旧的HTML或新的CSS +新的HTML来获得
。既然您首先更改了HTML

,它可能仍然会中断,但是从您说的人*是*

获得新的HTML很好。

-

Chris




" Chris Morris" < c。******** @ durham.ac.ukwrote in message

news:87 ************ @ dinopsis.dur.ac。 uk ...


" Mark F." < re ********* @ nospam.comwrites:


>< hu ********* @ gmail。在消息中写道
新闻:11 ********************** @ h48g2000cwc.googleg roups.com ...


>我已经更新了我的CSS,如果您查看主页面的旧css

缓存,它会破坏页面。是否有任何方法可以强迫观众将旧的css缓存以获得新的CSS?


我们的观众不懂科技,也不会'''知道什么是硬刷新

,也不需要它完成。


在头部使用元标记使页面过期。

< META http-equiv =" Expires" content =" Tue,1996年8月20日14:25:27 GMT">



无用 - 不会影响CSS文件,无论如何都会被任何

真正的HTTP标头覆盖。哦,当然,任何持有

页面的人卡在他们的缓存中都不会看到新版本。


最好的解决方案是将新的CSS文件复制到新的文件名,然后将
更改为指向新的CSS。然后他们应该使用旧的CSS +旧的HTML或新的CSS +新的HTML来获得
。既然您首先更改了HTML

,它可能仍然会中断,但是从你说的人*是*

获得新的HTML很好。



这没有意义。页面在到期时会被完全解析,因此,头部中列出的脚本将重新加载为

。你有任何失败的例子吗?



I have updated my CSS and if you view the main page with the old css
cached, it breaks the page. Is there any way to force viewers that
have the old css cached to get the new css?

Our viewers are NOT tech savvy, and wouldn''t know what a "hard refresh"
is, nor that it needed to be done.

解决方案


<hu*********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...

>I have updated my CSS and if you view the main page with the old css
cached, it breaks the page. Is there any way to force viewers that
have the old css cached to get the new css?

Our viewers are NOT tech savvy, and wouldn''t know what a "hard refresh"
is, nor that it needed to be done.

Use a meta tag in the head to expire the page.

<META http-equiv="Expires" content="Tue, 20 Aug 1996 14:25:27 GMT">


"Mark F." <re*********@nospam.comwrites:

<hu*********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...

I have updated my CSS and if you view the main page with the old css
cached, it breaks the page. Is there any way to force viewers that
have the old css cached to get the new css?

Our viewers are NOT tech savvy, and wouldn''t know what a "hard refresh"
is, nor that it needed to be done.


Use a meta tag in the head to expire the page.

<META http-equiv="Expires" content="Tue, 20 Aug 1996 14:25:27 GMT">

Useless - won''t affect the CSS file, and would be overridden by any
real HTTP headers anyway. Oh, and of course, anyone with a copy of the
page stuck in their cache won''t see the new version.

The best solution is to copy the new CSS file to a new filename, and
then change the HTML to point to the new CSS. Then they should either
get old CSS+old HTML, or new CSS+new HTML. Since you changed the HTML
first, it might still break, but from what you say people *are*
getting the new HTML fine.

--
Chris



"Chris Morris" <c.********@durham.ac.ukwrote in message
news:87************@dinopsis.dur.ac.uk...

"Mark F." <re*********@nospam.comwrites:

><hu*********@gmail.comwrote in message
news:11**********************@h48g2000cwc.googleg roups.com...

>I have updated my CSS and if you view the main page with the old css
cached, it breaks the page. Is there any way to force viewers that
have the old css cached to get the new css?

Our viewers are NOT tech savvy, and wouldn''t know what a "hard refresh"
is, nor that it needed to be done.


Use a meta tag in the head to expire the page.

<META http-equiv="Expires" content="Tue, 20 Aug 1996 14:25:27 GMT">


Useless - won''t affect the CSS file, and would be overridden by any
real HTTP headers anyway. Oh, and of course, anyone with a copy of the
page stuck in their cache won''t see the new version.

The best solution is to copy the new CSS file to a new filename, and
then change the HTML to point to the new CSS. Then they should either
get old CSS+old HTML, or new CSS+new HTML. Since you changed the HTML
first, it might still break, but from what you say people *are*
getting the new HTML fine.

That doesn''t make sense. A page is parsed completely when it expires,
therefore an scripts that are listed in the head will be reloaded fresh as
well. Do you have any example of how it fails?



这篇关于强制观众取消缓存css?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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