Introduction to Drupal caching

Drupal gives you various methods of caching your site's data and content by using the Drupal core administrative interface. There are a variety of contributed modules that allow for more advanced caching (we'll look at these in later chapters). Drupal allows you to cache data and content in order to speed up the performance of your site in terms of how quickly your pages and entire site loads for the end user.

Caching as much data and content as possible, especially the content that you show to your anonymous site visitors which includes content, blocks, and menus that may not change frequently, will help Drupal to speed up page load times on your site. Drupal will keep the cached data stored in a temp location either on the server or in the MySQL database. The site can easily fetch it for load time from that location.

Drupal does this by storing cached data in specific database tables of your MySQL database, so it can easily retrieve the cached data instead of recomputing, reloading, and reprocessing menu, block, and theme data each time the page loads. For example, your Drupal site may have 50 nodes of content. Each time someone visits your site they may load 5 of those nodes. The next time a visitor comes to your site and loads the same 5 nodes, Drupal has to process those nodes a second time, and each successive time for each visitor. So, what Drupal allows you to do is cache this data so that the node only loads once.

Drupal stores the cached version of the page in the cache table of the database. This way the next time a visitor launches that page, menu, or block item, they are loading the cached page. This ultimately speeds up the entire load process and load times of your site.

Drupal caches the following content and data:

• Menus and blocks

There are times, however, when you do not want to cache data and content on your site. This is what we're going to focus on now in this chapter. We want to take a look at the methods Drupal gives us for controlling our performance caching on our site, and the different options we can select for caching when we're, both, in development of our site and in production 'live' site environments. Other issues can come up with cached pages. If you are actively developing a site and working on content, when you make a change to a node and the site visitor loads a cached version of that node, they will not see your active changes to that node. So, this could be a drawback. We'll explore these different options and see how we can easily clear our performance cache, and also set the cache for a specific minimum lifetime so that you can expire a performance cache on a specific set of Drupal content.

0 0

Post a comment

  • Receive news updates via email from this site