SMOLNET PORTAL home about changes

Improve Drupal performance

I use YSlow to check a Drupal site performance. Here some tips to get an A with Drupal x.

YSlow (http://developer.yahoo.com)


Step 1: Fewer HTTP requests:

  • Aggregate CSS (/admin/settings/performance)
  • Aggregate JS with Javascript Aggregator (experimental). To avoid JavaScript errors in some modules (i.e. TinyMCE), you can use the dirscard list patch by derjochenmeyer on the dev version (it’ll be added to the next release). To Drupal x users: Drupal x comes with a native JS Aggregator support, so you don’t need an additional module.
  • Reduce CSS background images: select carefully your theme.


Step 2: Compress pages on-the-fly:
Many modern browsers support Gzip compression. Through .htaccess, you can tell your server to serve gzipped HTML pages, JavaScript and CSS files (or any other text file, since images like JPG and PNG are compressed natively). You can use two approach, depending on your server settings, just add on bottom of your .htaccess:

Gzip compression (http://en.wikipedia.org)


PHP flag method (compress only php served pages):

via-PHP compression (only with compatible browsers) php_flag zlib.output_compression On Apache mod_deflate method (preferred method where available)

Enable file compression by MIME type AddOutputFilterByType DEFLATE text/html text/plain text/xml AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/css # Exclude Not compatible browsers (uncomment to activate) # BrowserMatch ^Mozilla/4 gzip-only-text/html # BrowserMatch ^Mozilla/4\.0[678] no-gzip # BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

Using this method, you can compress HTML pages, JavaScript, CSS files specifying ;MIME type

;MIME type (http://en.wikipedia.org)


See also / references


*
*
*

https://web.archive.org/web/20080206000000*/http://developer.yahoo.com/yslow/ (https://web.archive.org)
https://web.archive.org/web/20080206000000*/http://drupal.org/project/javascript_aggregator (https://web.archive.org)
https://web.archive.org/web/20080206000000*/http://drupal.org/project/tinymce (https://web.archive.org)
https://web.archive.org/web/20080206000000*/http://drupal.org/node/216315 (https://web.archive.org)
https://web.archive.org/web/20080206000000*/http://en.wikipedia.org/wiki/Gzip (https://web.archive.org)
https://web.archive.org/web/20080206000000*/http://en.wikipedia.org/wiki/MIME (https://web.archive.org)
https://web.archive.org/web/20080206000000*/http://server.html.it/articoli/leggi/2077/risparmiare-banda-con-il-modulo-deflate-di-apache/2/ (https://web.archive.org)
https://web.archive.org/web/20080206000000*/http://wimleers.com/article/improving-drupals-page-loading-performance (https://web.archive.org)
https://web.archive.org/web/20080206000000*/http://drupal.org/node/249211 (https://web.archive.org)
Response: 20 (Success), text/gemini
Original URLgemini://chirale.org/2008-02-06_37.gmi
Status Code20 (Success)
Content-Typetext/gemini; charset=utf-8