PDA

View Full Version : Thoughts on caching and ext stylesheets



mankz
20 Aug 2008, 4:02 AM
I just upgraded from Ext 2.0.2 to Ext 2.2 and a thought struck me. If the ext dev team updates an image used in both 2.0.2 and 2.2 there could be a problem.

Take for example this piece of css, if the file mini-left.gif is used in ext-all.css in 2.0.2 and it has been modified in the 2.2 release, there could be users having a cached old version on their hard drive.


.x-layout-split-west .x-layout-mini{top:48%;background-image:url(../images/default/layout/mini-left.gif);}

My question is, is this just a theoretical problem (i.e. does the Ext never change images or when they do do they rename the file as well and update the stylesheet) or could this be a real problem?

My proposed solution would otherwise be to append the library version to each referenced image in the stylesheet files. The example css above would then look like:


.x-layout-split-west .x-layout-mini{top:48%;background-image:url(../images/default/layout/mini-left.gif?extversion=2.2);}

Animal
20 Aug 2008, 5:05 AM
But the server has a new version, and when the browser sends the request with an "If-Modified-Since" header of the date it was last read, the server will notice that the creation date on the image file is later, and send the image contents back rather than an empty packet with the HTTP "Not Modified" status.

mankz
20 Aug 2008, 5:42 AM
Ok, all browsers include the modified-since header? I kinda knew there was something I missed. Thanks for clearing this up for me...

:)