drupal-cache-tags

Implement Drupal cache tags with naming conventions for precise invalidation of rendered data.

3|5|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/sparkfabrik/sf-awesome-copilot --skill drupal-cache-tags
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drupal-cache-tags
Source: https://github.com/sparkfabrik/sf-awesome-copilot/tree/main/skills/drupal/cache/drupal-cache-tags
Command: npx skills add https://github.com/sparkfabrik/sf-awesome-copilot --skill drupal-cache-tags

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps Drupal developers implement cache tags to achieve targeted, reliable invalidation across render paths, ensuring updated content is shown when data changes.

Core Features & Use Cases

  • Tag naming conventions: learn standard tag formats for entities (entity_type:id), entity lists (entity_type_list), bundle lists (entity_type_list:bundle), configs (config:config_name), and custom tags (module:identifier).
  • Tag application: apply tags to render arrays, blocks, and cached data to ensure precise invalidation on updates.
  • Debugging and validation: verify cache tags in responses and troubleshoot stale content via common debugging patterns.

Quick Start

Identify a rendering path in your Drupal site and apply tag-based invalidation using the guide's patterns.

Frequently Asked Questions about drupal-cache-tags

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I invalidate Drupal cache tags when an entity changes?

To invalidate Drupal cache tags when an entity changes, apply standard tag formats like entity_type:id to your render arrays. This ensures precise cache invalidation, automatically clearing cached data only when the specific entity is updated.

What are the naming conventions for Drupal cache tags?

Drupal cache tag naming conventions use formats like entity_type:id for entities, entity_type_list for lists, and config:config_name for configurations. Custom tags follow the module:identifier pattern to isolate cache invalidation.

Why does my Drupal custom block show stale content after updates?

A Drupal custom block shows stale content when missing proper cache tags on the render array. Adding the correct entity or custom tags ensures the block's cache is invalidated immediately upon relevant data modifications.

How do I debug cache invalidations in Drupal render arrays?

Debug Drupal cache invalidations by inspecting response headers to verify active cache tags on render arrays. Troubleshoot stale content by ensuring tags are properly applied and invalidated during configuration updates or entity changes.

Do I need cache tags for Drupal configuration updates?

Yes, you need cache tags for Drupal configuration updates to prevent stale content. Apply config:config_name tags to render arrays so cached data is precisely invalidated whenever the matching configuration object is modified.