Drupal optimization

Drupal includes several configuration options that you can use to improve the speed and responsiveness of your web site. The procedures below show how to configure these options so that they are optimized for high performance.

The settings described in this article are for Drupal 7. Earlier versions of Drupal may not include some of these settings.
 
If you configure the settings as described below and your wesite performance is not yet at the desired level, there are additional options:
 
 VPS hosting packages on SSD servers

 

Caching

Drupal includes a built-in cache feature, but it is disabled by default. To enable caching for your web site, follow the steps below:

  1. log in to Drupal as an Administrator
  2. in the top menu bar, click Configuration
  3. in the DEVELOPMENT section, click on Performance
  4. In the CACHING section, check the Cache pages for anonymous users checkbox
  5. check the Cache block box
  6. in the Minimum cache lifetime box, select the length of time for which Drupal should cache files until it is renewed
  7. if the content of your web site is not changed frequently, you can set the cache lifetime for a longer period. Similarly, if you frequently update the content of the site, you must set a shorter cache life span
  8. in the cached pages expiration box, select the time period when external caches can use older versions of pages - in this case, external caches refer to client applications, such as web browsers
  9. Click Save configuration to save the configuration.

Drupal caching functions can increase the size of the database, which in turn can affect server performance.
You can periodically delete the cache from the database.

 

Cron jobs

Drupal includes a cron jobs work routine, which does not run by default. It is advisable to run chron jobs because they perform maintenance tasks that help to ensure better performance.

 

Compression

You can add Apache mod_deflate directives to the .htaccess file in the Drupal root directory to compress the output. Compression reduces the data traffic used and ensures faster page download times.

When caching is enabled, Drupal includes its own compression option in the administration interface. To access this option, in the top menu bar, click Configuration.

In the DEVELOPMENT section, click Performance.
In the Bandwidth Optimization section, look for Compress cached pages.
If this option is enabled, do not follow the Apache compression setup steps below (unless you clear the checkbox and disable the option).

ATTENTION: Use only one of these compression methods; do not use them simultaneously.

To enable output compression for Drupal, follow these steps:

Using a text editor open the .htaccess file in the directory where you installed Drupal. Add the following lines to the .htaccess file:

<IfModule mod_deflate.c>
        AddOutputFilterByType DEFLARE text/html text/css text/javascript application/javascript
    </ IfModule>

Save your changes to the .htaccess file. The changes take effect immediately.

 

JavaScript and CSS files

You can reduce web page loading times by optimizing JavaScript and CSS files. The process includes:

Combining JavaScript and CSS files. This reduces the number of HTTP requests required to load a page
Reducing the size (eliminating all unnecessary characters) of JavaScript and CSS files. This reduces the bandwidth required to load a page.

To do this, follow these steps:

        1. Authenticate to Drupal as administrator
        2. In the top menu bar, click Configuration
        3. In the OPTIMIZE BANDWIDTH section, select the Aggregate and compress CSS files check box
        4. Select the Aggregate JavaScript check box
        5. Click on Save configuration

 

Database tables

You should periodically optimize your Drupal database to ensure that your site loads as quickly as possible. The DB Maintenance Module allows you to quickly and easily optimize Drupal database tables at fixed intervals.

You can configure the module to optimize all Drupal database tables or just specific tables.
The DB Maintenance module supports both MyISAM and InnoDB engines.

To install and configure the DB maintenance module, follow these steps:

  1. Use your web browser to access https://www.drupal.org/project/db_maintenance
  2. In the Downloads section, download the .gz file for the Drupal version on your computer
  3. Authenticate to Drupal as an administrator
  4. In the top menu bar, click Modules, and then click Install new module
  5. Click on Browse, select the .gzde file on your local computer, and then click Install
  6. Under the following steps, click Enable newly added modules. The Modules page is displayed
  7. Scroll down to Other and select the ENABLED check box next to the DB maintenance module
  8. Click on Save configuration
  9. In the top menu bar, click Configuration and then in the SYSTEM section, click DB maintenance. The DB maintenance module configuration page is displayed
  10. In the Optimize tables list box, select how often you want to optimize the database tables

If you have a site loaded, you may want to optimize your database tables more frequently.

Select the tables you want to optimize:
             To optimize all tables, select the Optimize all tables check box.
             To optimize the specific tables, select the table or tables in the list box.
             Click on Save configuration.

 

Database registration

Drupal includes a database registration feature to help troubleshoot issues. Although it is useful for diagnosing problems, it can cause a large database growth. This consumes system resources and adversely affects server performance.
We recommend that you use it only if you need it.

 

If you encounter any problems in applying the above instructions, please contact us. HostX offers the best Drupal web hosting and can assist you in solving your problems.

Was this answer helpful? 0 Users Found This Useful (0 Votes)