Matt Glaman: Debugging your render cacheable metadata in Drupal

One of Drupal's greatest features, and often mysterious underworking to many site builders and developers, are its caching layers especially render caching. We have all been there before: we have no idea why it's not quite working, so we press "Cache rebuild" (or more infamously, "Flush all caches" of the pre-Drupal 8 eras), and like magic, things are displaying properly. Whenever we have to resort to clearing the cache to fix a page, that usually means a render cache item was not properly invalidated when it was supposed to have been. This is caused by missing cacheable metadata. Cacheable metadata is the information Drupal uses to understand when a cache item should be invalidated by its tags or maximum age. It's also used to provide variations of the cache based on context.

PubDate

Tags