Drupal CSS/JS Optimisation

I’ve been a web developer for a while now, and have only recently discover webpagetest, due to a client’s server being terribad.

JS/CSS files are aggregated,
Keep-alive turned on,
Got JS files in the footer,
Boost module is installed, with htaccess amendments (Page caching).

Yet still 10secs or so for a page render.

I’ve optimised problem is that drupal appears to create 5 css or js files each when compressing everything. So was trying to find a module that slapped everything into 1 or 2 files and came across this in depth article which suggests that putting JS files in the footer does nothing without further work.



Any chance you have a link to a test result you can share?

Yes, moving external javascript to the footer has to be done carefully because you need to make sure there are no inline scripts that depend on them that occur earlier in the page. If you have full control over the template and modules you can do it carefully.

A test result will help identify the key drivers for the long render time and help you target specific issues.



I used these modules with Drupal 6
Performance and scalability

  • CacheRouter 6.x-1.0-rc2 Controls access to split caching functionality into self contained objects.
  • DB Tuner 6.x-1.0-alpha2 Adds indexes to CCK fields used in views & more.
  • HTTP Parallel Request Library 6.x-1.x-dev Send http requests out in parallel in a blocking or non-blocking manner.
    Requis par : Imageinfo Cache (activé)
  • Imageinfo Cache 6.x-2.1 Cache image_get_info. Useful if files directory is not local. Will also generate imagecache presets in the background.
    Dépend de : ImageCache (activé), HTTP Parallel Request Library (activé), ImageAPI (activé)
  • JavaScript Aggregator 6.x-1.6 Compresses the aggregated JavaScript file when Optimize JavaScript is enabled.