drupal-caching

Installation
SKILL.md

Drupal Caching

Always add cache metadata. Missing cache metadata causes stale content.

Cache Metadata in Render Arrays

$build['content'] = [
  '#markup' => $output,
  '#cache' => [
    'tags' => ['node:' . $node->id(), 'node_list'],
    'contexts' => ['user.permissions', 'url.query_args'],
    'max-age' => Cache::PERMANENT,
  ],
];

Cache Tags

Installs
34
GitHub Stars
71
First Seen
Apr 17, 2026
drupal-caching — edutrul/drupal-ai