Optimizing Site Performance

Performance optimization is used to increase the speed content is displayed. As websites become more complex, with databases, user authentication, multiple themes, translations and JavaScript interactions all combining in complex ways, web caching becomes a vital tool for ensuring maximum site performance.

How web caches work

The web cache works by storing complete copies of each web page. Pages stored in the cache are served to site visitors immediately, bypassing the time-consuming process of real time page generation.

Dynamic page generation is more time consuming because each page must be recreated from scratch each time it is viewed. This typically involves retrieving relevant data from the database, combining it with multiple design elements, attaching CSS and JavaScript files, and finally displaying the completed page.

The problem with caching

There is one major disadvantage to using a cache. When you update or edit the site, your changes may not show to visitors until the cache is rebuilt. This is because the cache continues to display copies of pages as they existed when the cache was created.

For this reason, it is important to "clear the cache" each time you make significant edits. Once the cache is cleared, the site will begin to build a new cache, this time loading the updated page content. See below to learn how to clear the cache.

Standard caching options

Drupal provides a powerful set of standard caching features, including the following: 

  • cache page content
  • cache page blocks
  • cache custom views
  • optimize CSS files
  • optimize and compress JavaScript files

Advanced caching options

For the majority of sites, the standard performance features are sufficient. More powerful techniques are available for very large or very active sites. If maximum optimization is required we can install additional performance modules, such as BoostAuthcacheAdvanced CacheCache RouterAPCand Varnish. Please note that these are advanced techniques. In some cases they require the use of a Virtual Private Server (VPS) or a Dedicated Server.

How to set site performance configurations

  1. Login using your administrator account.
  2. Point your  browser to Administer > Site configuration > Performance
  3. Select Caching mode: Normal
  4. Enable page compression.
  5. Set a minimum cache lifetime. Please note that cron must be properly configured for this setting to work. The optimal cache lifetime is different for every site.
  6. Enable block compression.
  7. Enable CSS and JavaScript optimization.
  8. When you are ready, select Save Configuration.
  9. If your site produces errors when using caching, you can quickly turn all caching features off by selecting Reset to Defaults.

How to update the cache

  1. Login using your administration account.
  2. Point your  browser to Administer > Site configuration > Performance
  3. Scroll to the bottom of the form and select, Clear Cached Data.

Note

If you have access to the Admin Menu, there is a set of cache update links in the far left dropdown menu.

More Information