Caching on Drupal 8

piyuesh23

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 strategy taking big_pipe as an example.

The session will be focus on:

  • Drupal 8 render pipeline -- that allows for this flexibility

  • Architectural change for caching in Drupal 8

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

  • How reverse proxy like varnish/nginx can benefit from shared cache.

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

  • Big_pipe module as a case study

  • Bigpipe Anticlimax --- Implement a dummy / made up caching strategy that leverages caching internals in D8.

Key take-away:

  • Complete understanding on caching architecture of Drupal 8.

  • Dissection of BigPipe n-chunk strategy & how it leverages the baseline defined by core.

You can read about some of these findings on caching and bigpipe in D8 on my blog.

Session Track

Coding and Development

Experience Level

Advanced

Drupal Version