Minimizing TCP connections: Drupal’s Lightbox2 module
I’ve been trying to cut down on TCP connections per pageview for a Drupal 5 site which uses the Lightbox2 module. I noticed that the following images are loaded, even if none of the images on the page are lightboxed:
/sites/all/modules/lightbox2/images/loading.gif
/sites/all/modules/lightbox2/images/blank.gif
/sites/all/modules/lightbox2/images/prev.gif
/sites/all/modules/lightbox2/images/next.gif
/sites/all/modules/lightbox2/images/close.gif
/sites/all/modules/lightbox2/images/expand.gif
/sites/all/modules/lightbox2/images/pause.gif
/sites/all/modules/lightbox2/images/contract.gif
/sites/all/modules/lightbox2/images/play.gif
It’s possible that Firefox and IE (and/or Safari) behave differently in this case, where an image is called by the CSS background property but the containing element is set to display: none. I don’t see these as loaded in Firebug, but I do see them in “Page Info”, under Media, as well as in the HTTP access log.
Since I’m only using the loading.gif image for preloading (clicking the image itself or the overlay closes the lightbox), I want to keep from loading the rest. The solution here is to comment out the background property definitions in the lightbox2/css/lightbox.css file that call the remaining images. Having done that, the TCP connections needed for each non-cached pageview is reduced by 8.
Internet Explorer 7

Let me put it to you this way: only Internet Explorer 7 and Phoenix 0.1 put the refresh and stop buttons to the right of the address bar. Mozilla developers quickly realized how stupid that was and fixed it in Phoenix 0.3; but Microsoft, who had the correct idea since IE 1.0, decided after 9 years to unfix it in IE 7.
leave a comment