Constant Contact E-Newsletter Service - get 60 days free!

Constant Contact has been in business since 1996 is one of the most reliable and trusted email marketing services around. Click here to activate your free 60 day trial courtesy of CWD Community.

StreamSend Email Marketing - 30 Days Free

StreamSend is Email Marketing by Marketers, for Marketers. They offer a very friendly and easy to use interface, private IP address, trigger-based messaging, demographic reporting, integration with Google Analytics, and more. Click here to get 30 free days and give them a try.



Jan 28 2010

Speed up Your Website with Drupal Caching


Filed under: Content Management Systems » Drupal,
Tools:


Boost Your Drupal Performance with Caching

What is caching? A cache is a repository that saves a static version of a page, and loads it up when a user requests it. Websites, as well as browsers, use caching to reduce page load times and increase performance. By loading a static version of a page, there is all kinds of resource usage that can be saved - from database calls to loading images. Basically, a cached page is a saved version of a page that is loaded up when a user requests it. Caching is especially useful for pages that don't change often. If a page doesn't change, there's no point for a website or browser to reload and recreate every aspect of a page, making calls to databases, etc. to grab content, every single time a user visits the page. Without caching, a server's performance is impacted, bandwidth usage increases, and web page load times slow to a crawl.

What Caching Options Does Drupal Have?

With Drupal, you have several caching options at your disposal, especially if you have Drupal 6.x or later installed. The default Drupal installation comes with cache settings that you can access at /admin/settings/performance. Our recommended settings are as follows:

  • Caching mode: Normal
  • Minimum cache lifetime: 1 hour
  • Page compression: enabled
  • Block cache: enabled
  • Optimize CSS files: enabled
  • Optimize JavaScript files: enabled

The main thing to note here is the minimum cache lifetime. By setting the cache to 1 hour, you are storing pages in the cache for one hour before refreshing them. This means if there's an update to a page an anonymous user will see it within the hour.

There's also a clear cached data button that you can use to clear out all the caches at once. This is especially useful if you made a change to the site and are not seeing it, and are not sure where it may have been cached.

That brings us to an important distinction:

Drupal's default page caching only applies to anonymous users

This means if you're logged in, page caching will not be performed. This means page caching primarily benefits sites with a large amount of anonymous (not logged in) users. If your site is primarily affected by traffic from logged in users, you'll want to consider some of the caching modules below, in addition to Drupal's default caching options.

Turn off Caching for Development

If you're working on your site layout, or anything to do with CSS, graphics, etc., ie. you're developing or designing your website, you'll want to turn caching off so you can see the changes immediately.

Additional Caching Modules for Drupal

In addition to Drupal's default cache settings, there are quite a few useful modules you should consider to increase your website's performance:

  • Boost - The Boost module provides static page caching for Drupal, which should result in a significant performance and scalability boost for sites that receive mostly anonymous traffic. Apache is fully supported, with Nginx, Lighttpd and IIS 7 semi-supported. Boost will cache & gzip compress html, xml, ajax, css, & javascript, and you can have different cache lifetimes for different parts of your site. Boost uses a built in crawler that regenerates expired content for fast page loading.
  • Cache Router - CacheRouter provides a caching system that you can use to assign individual cache tables to different caching technologies - meaning you can use multiple caching mechanisms at once. CacheRouter also caters to anonymous users by allowing you to utilize Drupal's page_fast_cache part option.

Drupal Caching via Cron

Caching modules typically rely on cron calls (scheduled commands performed on your database on a regular basis). If you're not familiar with cron jobs, you'll probably want to download and install Drupal's PoorMansCron module.

Average: 3.4 (5 votes)
Tools:



Boost caching

Boost makes an unbelievable difference in page loading speed, and it doesn't seem to conflict with Drupal's native caching nor my various JavaScript applets that I have embedded in my pages. My vote goes for boost.

If you have time on your hands, some of the other methods may prove beneficial as well, but for most applications I'm thinking Boost does the trick.

Caching

Fast pages and useful content is an almost guaranteed way to increase site traffic. But is there a way to remove the word "node" from the url?

Enable the Path module to

Enable the Path module to create your own URLs, or also use the Pathauto module to create automatic URLs.

Ollie.
My Drupal Blog

Caching = faster browsing

Caching is a good idea. It will make your browsing faster. Thanks for this great idea.

Kristy Martin

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br> <br />
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.