[Trac] Css expiration

Ryan Schmidt trac-2005 at ryandesign.com
Wed Feb 9 07:20:20 EST 2005


On 09.02.2005, at 09:38, Manuzhai wrote:

>> Coud Trac return an expiration header info to the browser, to force 
>> the
>> browser to refresh its cache, or something similar ?
>
> At least for CSS, those are served without Trac intervention, directly
> through Apache. So if you're having problems with that, you should do
> some .htaccess magic.

I think the problem would be that when the browser asked the server for 
the old CSS file, the server said "here's the file, go ahead and cache 
this if you want" and so the browser did, and it hasn't asked the 
server about the file since. So now, there is no server-side setting 
you can alter to affect the browser behavior. The browser has already 
cached the old file and will not ask the server about a new file until 
it decides the document is too old for its cache. I do not know how 
browsers decide on this.

You can, however, modify your server configuration so that you're all 
set for future upgrades. For example you could set the static files to 
expire within 24 hours, or maybe even better, at a specific time -- for 
example, at midnight. That way, if you install a new version of Trac at 
the end of the day, everyone's cache will expire overnight and they'll 
get the new versions the next day.



More information about the Trac mailing list