Drupal how to: flush cache from one page

Dec 30, 2014

Joris Snoek - Business Dev
+31 (0)20 - 261 14 99

We want to speed up every Drupal website as much as possible. In doing so, good caching is essential; so we set all caches as much and ‘hard’ as possible to ensure Drupal websites are high performance.

Changes not visible

The disadvantage of relatively “hard” caching is that textual changes, for example a blog post, are not directly visible to the visitors of your website. Usually you would prefer to see those changes, as these are often concerning language and grammatical errors that you have corrected.

Standard you would have to flush the cache of all pages in Drupal, which is a shame. Because this is at the expense of the performance of your Drupal website.

Flush page cache

The Drupal module ‘flush page cache’ offers a solution: it makes it possible to flush the cache of one page so that your changes are directly visible to anonymous visitors whenever you want.
As you can see in the screenshot above you will have an additional menu item that allows you to flash the current page.

Setup

The setup is easy:

  1. Download and install the module
  2. Add the following code in your settings.php:
  3. $conf[‘cache_inc’] = ‘./sites/all/modules/flush_page_cache/flush_page_cache.cache.inc’
  4. Add optional additional cache flush actions when you use this function under /admin/config/development/flush_page_cache:

Readme.txt

Read the readme.txt of the module for more instructions. If you use for example Memcache you should include another code in your settings.php. More exceptions are possible depending on your Drupal installation.

Comments

Stay up-to-date

Subscribe to our Lucius newsletter
and be the first to know about new articles!

Need even
more knowlegde?