drupal-cache-maxage

Configure Drupal max-age caching rules for anonymous and authenticated requests.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Drupal max-age caching concepts are often misunderstood, leading to performance or freshness issues on Drupal sites.

Core Features & Use Cases

  • Understand how max-age interacts with Page Cache and Dynamic Page Cache to determine what gets cached and for how long.
  • Learn practical guidelines for selecting max-age values (0, Cache::PERMANENT, numeric seconds) and how bubbling affects render trees.
  • Troubleshoot common scenarios such as UNCACHEABLE content and stale content despite time expiration.

Quick Start

Describe a Drupal page scenario and I’ll suggest the appropriate max-age configuration.

Frequently Asked Questions about drupal-cache-maxage

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

FAQPage Schema
How does Drupal max-age interact with Page Cache and Dynamic Page Cache?

Drupal max-age controls caching duration for both anonymous and authenticated requests by interacting with Page Cache and Dynamic Page Cache. These layers use max-age values to determine what gets cached and for how long across the render tree.

What is the correct max-age value to use for Drupal cache settings?

Drupal max-age values include 0 to disable caching, Cache::PERMANENT for non-expiring cached content, or numeric seconds for time-based expiration. Selecting the right value depends on your specific content freshness and performance optimization requirements.

Why is my Drupal cached content stale despite max-age time expiration?

Stale Drupal content despite max-age expiration often occurs due to incorrect max-age bubbling in the render tree or improper Cache::PERMANENT settings. Troubleshoot by verifying max-age values propagate correctly across all nested render elements.

How do I debug UNCACHEABLE content in Drupal's caching system?

Drupal UNCACHEABLE content occurs when max-age is set to 0, preventing Page Cache and Dynamic Page Cache from storing responses. Debug by examining render array cache metadata and ensuring max-age bubbling propagates appropriate values upward.

Does Drupal max-age bubbling affect authenticated and anonymous requests differently?

Drupal max-age bubbling affects both request types but through different cache layers. Anonymous requests use Page Cache for full page caching, while authenticated requests leverage Dynamic Page Cache, both respecting max-age values bubbling from the render tree.

When should I use Cache::PERMANENT instead of a numeric max-age in Drupal?

Use Cache::PERMANENT in Drupal max-age configuration when content has no time-based expiration requirement and remains valid until explicitly invalidated. Use numeric seconds when content must automatically expire after a specific duration to ensure freshness.