Flickering CSS background images IE6 - solution for lighttpd

written by zsombor on May 14th, 2006 @ 11:30 AM

Just thought I share a small tip from the tranches, while working on Harvest a terribly useful timetracking application!

Simple timetracking powerful reporting

Tabs with CSS background images set appeared to flicker annoyingly whenever on mouse hoover. This affected only IE, guess this is not a surprise after all the oddities one must face with this browser. Also it only annoys users with their browser cache set to ””Every visit to page”. Typically these are webdevelopers, end-users rarely have this setting on. Numerous solutions exist, an see excellent description by Ryan Carver.

Fixing this with lighttpd is quite simple, just add the following lines to your lighttpd.conf file:

expire.url = ( "/images/" => "access 1 hours"
               "/javascripts/" => "access 1 hours"
               "/stylesheets/" => "access 1 hours")

This using the mod_expire module will set the proper HTTP headers for browser-side cache management. In strict terms you only need to set this for images to solve the problem. Setting for all static assets should improve user general experience by making more effective use of web caches.

Comments

  • Gabriel Radic on 14 May 11:30

    Nice little app, but I’m not sure I’d pay for it.

Post a comment

Options:

Size

Colors