Back to top

Drupal Performance Tips


Hi Everyone,

Tip 1: Enable the query cache in MySQL
How ??
* You can setup them in /etc/my.cnf (Red Hat) or /etc/mysql/my.cnf (Debian) file:
* # vi /etc/my.cnf
Append config directives as follows:
query_cache_size = 268435456
* You can get the suggestions for my.cnf settings using this script MySQL Performance Tuning Primer Script. Place this script in /etc folder and run using sh /path-to-file/

Tip 2: How to Compress HTML FILES using gzip and Apache mod_deflate

* Add this code in .htaccess

# compress all text & html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml

# Or, compress certain file types by extension:

SetOutputFilter DEFLATE

* If you are in shared hosting then you can try adding this code in index.php of your drupal installation. Which will compress pages and saves the data transfer and time.
You can check your site Gzip enable or not from here

Tip 3: How to Compress CSS and JS files using gzip.

Drupal 6 core itself Gzip's Js files. To compress CSS files please use

Anil Sagar

on 12 Feb 2010 by
Super Admin
Office ghost