Hi.
But you have to change the headers for CSS files well in advance of a
rollout (generally months but depends on web server configuration), so
that all browsers (and transparent proxies) will actually connect to
the server to get/determine that the CSS file has changed.
I'd avoid ever setting no-cache or must-revalidate on CSS files
because it slows down page loading and places unnecessary load on the
server.
New filenames is probably the answer.
Haven't used it for CSS before, but what about just adding something
like:
?ver=9.9.9
e.g.:
<link href="/mysite.css?ver=1.0.3" rel="stylesheet" type="text/css"
media="all" />
to the end of the link URL and changing the version number on any
major CSS change? That way one can keep the same filenames but still
force the CSS to be reloaded.
-Craig
On 6/07/2009, at 9:06 AM, Paul Bennett wrote:
> something like this?
>
> <?php
> header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
> header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
> ?>
>
> http://php.net/manual/en/function.header.php
>
> Would have to be added on a per-file basis and the server config would
> need to be altered to pass css etc through php first, but in theory it
> would work.
>
> Trademe is an MS shop though, but I'm sure similar tricks exist.
>
> Maybe it would have been better for them to shift to new stylesheet
> filenames for the new version of their site? This would have stopped
> the issue they seem to be facing...
>
> Paul
--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---