I'm looking at improving the page load time on my site. Firebug says my /tracker page takes 2.9 seconds to load in the browser, which is a bit excessive. I did some research on acceptable page load times, and found there's quite a range of opinion on what's ok.

I have been browsing the performance hints in the drupal handbook ... but they don't cover one thing I'm seeing.

According to firebug on every pageload the various and sundry .js and .css files get reloaded on every pageview. According to the getfirebug site if a request is handled from the browser cache, then it's shown with a light grey, but in my case all the requests for these files are in a dark grey indicating they loaded directly from the site each time.

I don't understand.. these files are static and at a fixed URL, so they should load once, the first time the site is visited, and then get reused from the browser cache each time.

FWIW the site is running drupal 5.2, served on a CentOS 4 system, php 4.x .. my browser is firefox 2.x on ubuntu 7.04

I did turn on .css combining in the performance admin area, and that sqoze the .css to one file but firebug still shows that one file being redownloaded on each pageview.

Comments

hurleyit’s picture

I'm not sure if you have heard of it, but there is an extension, YSlow, that works with Firebug to see why pages are slow, https://addons.mozilla.org/en-US/firefox/addon/5369. The first thing I think of though is whether or not you have an expires header set for those components. Yslow will be able to tell you that. If you don't, my understanding is that the browser won't cache those components and will try to download it again.

reikiman’s picture

Thank you, I'll check that out. Firebug does show that there are Expires headers on the files and the expiration is set about 2 weeks out.

- David Herron - http://7gen.com/

reikiman’s picture

I installed it..and.. YSlow agrees the drupal .js files have an Expires headers, the only ones that do not are from the Snap Preview service I have installed. I'm beginning to think to ditch that.. it's cute but it's adding to the payload that has to be run on every page.

It does say I need to configure ETags.. since this is the first time I've heard of ETags I'll have to read up on this. There are ETags available for every piece being downloaded, so...?

It also suggests gzip'ing the .js files, but I have my doubts as to the benefit. The problem is they're being rerequested on each page load. Hurm... under the Components column it shows which ones are being gzip'd and the main page is not being gzip'd.. that page is 75kb, so making sure it's gzip'd would help. I'm not sure of what I have to do to make that happen, though.

- David Herron - http://7gen.com/

reikiman’s picture

In the httpd.conf for this site I added: SetOutputFilter DEFLATE ... the 59kb page size deflated to 8kb. That helps. The HTML and all the .js and .css are being compressed now.

ETags were'n't configured, so I inserted the code the apache manual said to use, and that didn't make any difference (FileETag All).

- David Herron - http://7gen.com/