Drupal 8 caching improvements

Drupal Username
Synopsis for Sessions

Caching architecture has changed considerably in Drupal 8. Cache tags and contexts gives Drupal 8 the smarts to identify sections from the whole page, allowing for dynamic parts to be cached as well. The non-cacheable parts also-known-as placeholders; holds the promise of Lazy loading and allow for multiple flush strategies by which they come undone.

Drupal core provides with one strategy for processing placeholders called as ‘single flush’ but in spirit of Drupal allowing contrib to extend it, it’s possible to replace flushing strategy with your own. Been hearing of Bigpipe often? Thanks to Drupal 8 caching infrastructure, bigpipe strikes gold at n-chunks.

In this session, we will talking about how a contrib module can leverage this & create a custom placeholder flush strategy like big_pipe module in core does.

  • Problems with caching layer/cache architecture in Drupal 7

  • Architectural change for caching in Drupal 8

  • Introduction to cache tags, contexts & placeholders (with code examples & a short demo).

  • Handling #uncacheable content with Drupal 8

  • How reverse proxy like varnish/nginx can benefit from cache. (Varnish setup with Drupal 8 as an example)

  • How to leverage Drupal 8’s caching architecture to change the way data is rendered.

  • Big_pipe module as a case study for understanding n-flush strategy

Key take-away:

  • Complete understanding on caching architecture of Drupal 8.

  • Understanding of the value around the big change around caching layer.

  • Understanding of things Drupal 7 lacked in terms of caching.

Slide Deck