Thursday, 6 March 2014

How to Speed up your Drupal 7 website

Before we go into the details of techniques and tips to speed up drupal 7, lets understand what slows down drupal.
  • Database queries
  • Loading CSS, Javascript and Images.
  • Loading unwanted modules
  • Now some quick things for speed up and optimize your drupal are listed below.

1. Aggregate your JavaScript and CSS files

Before we look at any third party modules lets examine what Drupal has built-in that can help. Navigate to Administer –> Site Configuration –> Performance. This section allows users to enable/disable specific caching functions included in Drupal CORE. Here are my recommendations for a typical Drupal site:
  • Caching Mode: Normal
  • Page Compression: Enabled
  • Block Cache: Enabled
  • Optimize CSS Files: Enabled (use in production only, not during theme development or customization)
  • Optimize JavaScript Files: Enabled (use in production only, not during theme development or customization)
2. Disable unused modules

Go to http://yoursite.com/admin/modules and disable all the modules that you don't need. Uninstalling them can help too.

3. Install DB Maintenance-module

This module can be found at http://drupal.org/project/db_maintenance. This module optimizes your databases during your cron-runs. Mostly the effect is small, but in the long run, it's good to have.

4. Remove content you don't need

This includes nodes, users etc which you don't need anymore. These types of content will fill your database with unnecessary data, which is good to remove once in a while.

5. Use Memcached

Memcached is a bit of an advanced solution for optimizing your website, but for some people it is necessary. The Drupal module can be found at http://drupal.org/project/memcache. It has a ton of settings, so you should carefully read the documentation before using this module.

6. Tune your MySQL

If you are using MySQL as your database and you have access to your my.cnf, you should definitely download and run MySQL Tuning Primer Script. This script will analyze your database and recommend you in plain english which values in my.cnf you should change. This can lead to great performance boosts.

7. Avoid using PHP Code in your blocks and nodes

Using PHP Code in fields can have some performance drawbacks. The code is first fetched from the website, then it is executed by PHP. In this way, the code is never cached by accelerators or other caches. It can also be slower to execute than "normal" code.



No comments:

Post a Comment

.