IE6 does not cache my filtered pngs

When using png images as background, you need to apply a trick to make Internet Explorer 6 to display the background as transparent:


filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='crop');


I realized though that if Internet Explorer caching setting is set to Every visit to the page, the png file is dowloaded multiple times if you have the same picture more than once in the same page and, in some cases, even ofter if you are doing some DOM manipulation.

The solution is to add the Cache-Control header to the http response serving the png.

In apache, you can for instance do it using the following directive:


<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control: "private, max-age=21600"


after having loaded the module "headers".

See this nice post on how to do htaccess Caching


Popular posts from this blog

Home Assistant in Docker on MacOs BigSur

The little yellow book of vaccinations

Installing Box Backup on a ReadyNas NV+ (sparc)