473,790 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forcing viewers to un-cache css?

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.

Nov 8 '06 #1
10 9045

<hu*********@gm ail.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.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">

Nov 9 '06 #2
"Mark F." <re*********@no spam.comwrites:
<hu*********@gm ail.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.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
Nov 9 '06 #3

"Chris Morris" <c.********@dur ham.ac.ukwrote in message
news:87******** ****@dinopsis.d ur.ac.uk...
"Mark F." <re*********@no spam.comwrites:
><hu*********@g mail.comwrote in message
news:11******* *************** @h48g2000cwc.go oglegroups.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?


Nov 9 '06 #4
Mark F. wrote:
<hu*********@gm ail.comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.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?
No. If age information was sent previously, either the cached resource
needs to expire, the cache must be cleared, or the user must force it to
be updated. If only a validator was sent, then there shouldn't be any
problem, however a browser or intermediary cache can be forced to cache
data in spite of (some) directives from the server if it's more
beneficial to the user than up-to-date information.

[snip]
Use a meta tag in the head to expire the page.
A meta element cannot be expected to control caching: an intermediary
cache is very unlikely to check the message body, and even a browser
doesn't have to respect it. Caching should be controlled only by HTTP
headers. Besides, how does this help data that's already been cached? If
the user agent isn't going to the server, how is it going to read this
meta element?

Mike
Nov 9 '06 #5

"Michael Winter" <m.******@bluey onder.co.ukwrot e in message
news:x0******** ***********@tex t.news.blueyond er.co.uk...
Mark F. wrote:
><hu*********@g mail.comwrote in message
news:11******* *************** @h48g2000cwc.go oglegroups.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?

No. If age information was sent previously, either the cached resource
needs to expire, the cache must be cleared, or the user must force it to
be updated. If only a validator was sent, then there shouldn't be any
problem, however a browser or intermediary cache can be forced to cache
data in spite of (some) directives from the server if it's more beneficial
to the user than up-to-date information.

[snip]
>Use a meta tag in the head to expire the page.

A meta element cannot be expected to control caching: an intermediary
cache is very unlikely to check the message body, and even a browser
doesn't have to respect it. Caching should be controlled only by HTTP
headers. Besides, how does this help data that's already been cached? If
the user agent isn't going to the server, how is it going to read this
meta element?

Mike
Ok, I stand corrected on the meta tag, however, I disagree with you on one
point. If the cached object(s) is stale, or the expiration time is expired,
or the data has been set to only one session, the page and scripts will be
re-cached from the server. I've never had problems updating sites using an
expiration date or the like.

Mark
Nov 9 '06 #6
"Mark F." <re*********@no spam.comwrites:
"Chris Morris" <c.********@dur ham.ac.ukwrote in message
[meta refresh on the page is] Useless - won't affect the CSS file,

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?
The browser will parse the page, yes, and will probably make
conditional requests for 'attached' items such as styles, scripts,
images, etc. If there's an intermediate cache (which may be the
browser's own, if its caching policy is right) then you can get this
situation:

[server] <--[cache] <--[browser]
page expired expired
css current expired

So, the browser makes a conditional request for the page, and gets the
new one, but when it conditionally requests the CSS, the cache thinks
(wrongly) that it has an up-to-date copy, and sends that back without
checking with the origin server.

It doesn't even need an intermediate cache, if the browser is
sufficiently confident that the CSS file is current that it doesn't
even bother with a conditional request (and it doesn't *have* to make
one) - if you can dig out an old copy of Opera 6 that hung on to old
CSS files even on a shift-reload of the HTML sometimes: you had to
shift-reload the CSS file itself to convince it to check for a new
one...

--
Chris
Nov 9 '06 #7
..oO(Mark F.)
>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.
No. Just because the main document expires doesn't mean that all other
referenced external documents expire as well. Every single resource, be
it an image, CSS, script, whatever, is completely independent from each
other.

Micha
Nov 9 '06 #8
Mark F. wrote:

[snip]
If the cached object(s) is stale, or the expiration time is expired,
or the data has been set to only one session, the page and scripts
will be re-cached from the server.
The stale and invalidated entities will be, yes, but the assessment of
age or validity is made on a case-by-case basis. That one is now stale
or invalid doesn't automatically invalidate other resources, whether
they are related or not.
I've never had problems updating sites using an expiration date or
the like.
That statement doesn't mean much without knowing the precise
circumstances in which you observed what you did. That is, the
configuration of your browser, the state of your cache, the headers sent
by the server, and the headers sent by the browser are all important
factors.

Mike
Nov 10 '06 #9

Michael Winter wrote:
Mark F. wrote:

[snip]
If the cached object(s) is stale, or the expiration time is expired,
or the data has been set to only one session, the page and scripts
will be re-cached from the server.

The stale and invalidated entities will be, yes, but the assessment of
age or validity is made on a case-by-case basis. That one is now stale
or invalid doesn't automatically invalidate other resources, whether
they are related or not.
I've never had problems updating sites using an expiration date or
the like.

That statement doesn't mean much without knowing the precise
circumstances in which you observed what you did. That is, the
configuration of your browser, the state of your cache, the headers sent
by the server, and the headers sent by the browser are all important
factors.

Mike
Just so everyone knows.

What I did was leave the old html and change only the css, which didn't
break the old html, only the new.

Then, two days later, released the new html, in hopes that those that
had it cached didn't have on "perma-cache" and had downloaded the new
CSS by that point.

Seems to have gone well, btw.

Nov 10 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6292
by: Agathe | last post by:
Bonjour, Je souhaite insérer dans une table MySQL des données provenant d'un fichier texte grâce à un script PHP. Mon fichier porte l'extension "txt" et les données sont séparées par des ";'. J'ai créé un script qui upload le fichier texte sur le serveur et qui lit le contenu de chaque ligne, sépare chaque champ, puis stocke les données dans un tableau indicé pour ensuite insérer ces données dans une table MySQL. Mon script fonctionne...
3
1758
by: ted holden | last post by:
Dumb question... Does PHP have any facility for utilizing flash, shockwave, quicktime, or any such media viewer from inside some browser application?
0
1528
by: _Doug | last post by:
I'm trying to do a simple Crystal report from a simple text data base, and get: Access to the path "C:\\Program Files\\Microsoft Visual Studio .NET\\Crystal Reports\\Viewers\\dynamic_images" is denied.
22
2813
by: Mason A. Clark | last post by:
I am making a page that will depend on JavaScript. Is this a problem: the viewers' browser not running JavaScript? I did a quick survey of the top of one list of Top 500 web sites in popularity -- my javascript turned off. Almost no problem in simply viewing the pages but I did *not* test any dynamics. JavaScript was used for some purpose on almost
3
16111
by: Jorge Gallardo | last post by:
Hola de nuevo a todos... Agradecido a todos los que me habeis solucionado problemas anteriores... Pero como no es novedad, me surge otro. Recientemente buscando, adquiri un codigo para juntar 3 ficheros de texto. El cual adapte para el desarrollo de mi DB. El proceso es genial, pues junto los tres ficheros pulsando solo un boton. (O determinada accion EVENTOS)
2
2377
by: jason | last post by:
Hello, Does anyone have any experience with 3rd Party Crystal Report viewers? I'm looking for a viewer that allows me to view reports in our web app without having crystal reports installed on the app server. Does such a thing exist? I also need the rpt files to be independant of saved data and db connection info. Thanks in advance. JS
1
1726
by: Mark Richards | last post by:
Hi. I am basically a novice with access. Sorry for the long question, but I can't find a short way to make this clear.... I have a database I created to track service calls for a client with a few dozen buildings across the state. They require a monthly report sorted by location showing all the activity for a given month (**even if there was no activity for a given location**). I have a basic DB structure I copied from the access...
3
1192
by: Peteroid | last post by:
Is it possible to make a public parent class method unavailable (i.e., generate an error at compile time) to a particular child class? For example, say a parent class has a public method Add( ). I want to create a child class of this parent class that does not have an Add( ) method (while possibly another child class does). I think I figured it out while writing this, so tell me if this is the 'standard method'. Make the parent class...
1
3378
by: Alex | last post by:
Ciao a tutti, sto sviluppando un applicazione windows, in breve all'interno dello stesso namespace ho un form con una datagrid e un thread che effettua dei controlli e "dovrebbe" caricare i dati sulla datagrid stessa. - nel namespace ho dichiarato un riferimento al form in questo modo: private static Form1 f; - nel form load istanzo e lancio il thread, nel thread eseguo i
4
3105
by: Dan Krantz | last post by:
I have the following template to ensure that a given number (val) falls into a range (between vmin & vmax): template<typename T> T ForceNumericRange( const T& val, const T& vmin, const T& vmax) { T retVal = val; if ( retVal < vmin ) retVal = vmin;
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.