I’m working on making Drupal 8 faster as part of my job at Acquia. The focus has been on render caching12, which implies that cacheability metadata is of vital importance in Drupal 8.
To be able to render cache all things that can possibly be render cached, Drupal 8 code must:
- set the right cache
max-age
βΒ to ensure only the cacheable parts of the page are cached - set the right cache
contexts
β to ensure content is varied as expected (per language, per role, per timezone, per user β¦) - set the right cache
tags
β to ensure rendered content is invalidated when the data it depends on is modified
Before Drupal 8, approximately zero attention was given to cacheability of the rendered content: everything seen on a Drupal 7 page is rendered dynamically, with only the occasional exception.
By flipping that around, we make developers more conscious about the output they’re generating, and how much time it takes to generate that output. This in turn allows Drupal 8 to automatically apply powerful performance optimizations, such as: