Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/abderrahimghazali/drupal-boost/caching-strategynpx skills add abderrahimghazali/drupal-boost --skill caching-strategygit clone --depth 1 https://github.com/abderrahimghazali/drupal-boostWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/abderrahimghazali/drupal-boost/caching-strategy)<a href="https://agentmods.dev/skills/abderrahimghazali/drupal-boost/caching-strategy"><img src="https://agentmods.dev/badge/skills/abderrahimghazali/drupal-boost/caching-strategy.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00042 | $0.01003 |
| Opus 5 | $0.00021 | $0.00502 |
| Sonnet 5 | $0.00008 | $0.00201 |
| Haiku 4.5 | $0.00004 | $0.00100 |
Grade A, and why
caching-strategy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 140 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Drupal Caching Strategy
Cache Metadata (The Three Pillars)
Every render array MUST include cache metadata:
$build = [
'#theme' => 'my_template',
'#data' => $data,
'#cache' => [
'tags' => ['node_list', 'node:42'], // WHAT invalidates this
'contexts' => ['user.permissions', 'url.path'], // WHAT varies this
'max-age' => 3600, // HOW LONG to cache (seconds)
],
];
Cache Tags — "What invalidates this cache?"
node:NID— Invalidated when a specific node changesnode_list— Invalidated when any node is created/updated/deleteduser:UID— Invalidated when a specific user changestaxonomy_term:TID— Invalidated when a term changesconfig:system.site— Invalidated when site config changes- Custom:
MODULE_NAME:ENTITY:ID
Invalidate manually:
\Drupal\Core\Cache\Cache::invalidateTags(['node:42']);
Cache Contexts — "What makes this vary?"
user— Different per useruser.permissions— Different per permission set (fewer variations)user.roles— Different per role combinationurl.path— Different per URL pathurl.query_args— Different per query stringurl.query_args:sort— Different per specific query paramlanguages:language_interface— Different per languagetheme— Different per themeroute— Different per route
Max-Age
Cache::PERMANENT(or-1) — Never expires (invalidated by tags only)0— Uncacheable (use sparingly — kills performance)3600— Cache for 1 hour86400— Cache for 1 day
Cache Bubbling
Cache metadata "bubbles up" from child elements to parents. Drupal automatically merges:
- Tags: Union of all tags
- Contexts: Union of all contexts
- Max-age: Minimum of all max-ages (most restrictive wins)
This means if ANY child has max-age: 0, the entire page becomes uncacheable.
Lazy Builders
For uncacheable content within cacheable pages:
$build['dynamic_part'] = [
'#lazy_builder' => ['MODULE_NAME.my_service:renderDynamic', [$entity_id]],
'#create_placeholder' => TRUE,
];
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 140 lines · 42 tokens per session scan A 0d4ac4cbe83f
caching-strategy is a skill published in the GitHub repository abderrahimghazali/drupal-boost (1 stars, last pushed 5mo ago), licensed MIT. It adds 42 tokens to every session and 1,003 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
bun-redis
Use when working with Redis in Bun (ioredis, Upstash), caching, pub/sub, session storage, or key-value operations.
ts-db-perf
Optimize TypeScript code that interacts with databases. Use this skill when the user wants to fix N+1 queries, add caching, improve transaction safety, prevent race conditions, simplify async flows, or generally speed up a TypeScript backend. Triggers on phrases like "optimize", "slow query", "N+1", "race condition"…
caching
HybridCache (.NET 9+), output caching, cache-aside pattern, and IMemoryCache — registration, usage, invalidation, and key strategy.
Cache Strategy Consistency Guard
Detect undefined or inconsistent cache strategies (layers, consistency, invalidation, TTL, failure handling) in design documents.
caching
This skill should be used when the user asks about a "caching strategy", "cache invalidation", "what to cache", "read-through vs write-through vs write-back", "cache eviction" (LRU/LFU/TTL), "Redis vs Memcached", "stale reads", or hits "thundering herd", "cache stampede", "cache penetration", or "hot key" problems.…
drogon-gen-redis-config
生成 drogon 项目的 Redis 配置(config.json 片段)。.