Follow us on Twitter!
Syndicate content
Login - Register - Latests submissions

Optimization

Consider installing the Boost module to create static HTML versions of pages that are served anonymously. Cached pages don't even use PHP (they are served as .html files) let alone create or use queries in MySQL so caching is super fast. Cached pages can be cleared on a regular basis with cron. Works with multisites and provides speed improvements to almost any Drupal site. Requires modification of default .htaccess file.

Having an .htaccess file is a pain regarding performances. Apache needs to read it on every single request (the page, every image, CSS files, JS files, etc.).

It is strongly recommended to move rules defined in Drupal .htaccess file in your Apache global configuration or in your vhost configuration file. This way all rules are only loaded 1 time, during Apache start.

To achieve this, just copy/paste your .htaccess content in your Apache server configuration file and don't forget to surround it by the directory where your Drupal install resides.

<Directory /var/www/path/to/drupal/directory/>
  AllowOverride None
  ###      ALL YOUR .HTACCESS CONTENT GOES HERE    ###
</Directory>

Note that we added AllowOverride None to prevent Drupal .htaccess to be read by Apache.

Check for syntaxe error:

$ apachectl configtest

And restart Apache:

$ apachectl restart

Note that if you are on Plesk, you must use the following command before restarting Apache:

$ /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=example.com

  • Go to Administer > Site configuration > Performance
  • Set Caching mode to Normal or Agressive
  • Set Block cache to Enabled
  • Save your settings

In regards to page compression, you will find on admin/settings/performance a description that looks like By default, Drupal compresses the pages it caches in order to save bandwidth and improve download times. This option should be disabled when using a webserver that performs compression. To find out whether your server already performs compression have a peek at /etc/httpd/conf/httpd.conf (CentOS/Redhat) or /etc/apache2/mods-enabled (Debian/Ubuntu) to find out if the module mod_deflate is called. If so, turn off page compression.

You're done!

Go to Site configuration > Performance, in Bandwidth optimizations section:

  • Set Optimize CSS files to Enabled
  • Set Optimize JavaScript files to Enabled
  • Save your settings

It is recommended to put JavaScript files at the bottom of your document (i.e. your theme page.tpl.php). Here is an example with Garland, but it should be the same with other themes. Search for the line <?php print $scripts ?>:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
  <head>
    <?php print $head ?>
    <title><?php print $head_title ?></title>
    <?php print $styles ?>
    <?php print $scripts ?>
  </head>

Cut and paste it just before the <?php print $closure ?> statment and before the closing </body> tag, as shown below:

  <?php print $scripts ?>
  <?php print $closure ?>
  </body>
</html>

It is recommended that websites provide translated versions of their online content in multiple languages for maximum reach. NativeTung - http://www.nativetung.com - is a powerful solution that works with the Drupal CMS platform.

Drupal makes it easy to achieve the following with the NativeTung Globalizer: Globalize --> Optimize --> Analyze your site for increased ROI and reach across the language barrier.