nette/agent-plugins/nette-caching
- community
Checking that the SKILL.md file is still in the repository.
Invoke before writing or reviewing code that uses nette/caching. Covers the Cache object and namespaces, load() with a generator callback, save(), remove(), clean(), the dependency array (Cache::Expire, Cache::Tags, Cache::Files, Cache::Items, Cache::Priority, Cache::Sliding, Cache::Callbacks), the Journal requirement for tags and priorities, bulkLoad(), output capture, storages (FileStorage, MemcachedStorage, SQLiteStorage, MemoryStorage, DevNullStorage) and the {cache} Latte tag. Also trigger for cache.storage or cache.journal in NEON, invalidation by tag, cache stampede, or disabling the cache in tests. Not for the Latte template cache or the DI container cache, which are separate mechanisms.
Install
npx vskill@latest install nette/agent-plugins/nette-cachingSKILL.md
Nette Caching
Dependency Constants – Exact Names
Since 3.1.3 the constants are PascalCase; the UPPER_CASE names survive as deprecated aliases, which makes wrong guesses fail in confusing ways.
Cache::EXPIRATION does exist (deprecated alias of Expire); Cache::Expiration does not and is a fatal Undefined constant. There is likewise no forget(), no delete() and no has() – removal is remove($key), which is just save($key, null).
Reading and Writing
- The generator gets
$dependenciesby reference; the same array can instead be the
third argument of load() or save(). If it throws, the entry is removed.
load($key)without a generator returnsnullon a miss, sonullis not storable:
save($key, null) removes the entry, as does an Expire resolving to <= 0.
Cache::Expireaccepts seconds, a UNIX timestamp, or anyDateTime::from()string.
Keys may be any serializable value, not just strings; save() returns the value.
Tags and Priorities Need a Journal
FileStorage and MemcachedStorage throw Nette\InvalidStateException: CacheJournal has not been provided. on the write as soon as Cache::Tags or Cache::Priority is present and no journal was injected. The default journal is SQLiteJournal, and the DI extension registers it only if `pdo_sqlite` is loaded – without that extension every tagged save() blows up at runtime. SQLiteStorage implements tags in its own table and needs no journal, but it stores no metadata: only Expire, Sliding and Tags survive, while Priority, Files, Items, Constants and Callbacks are silently ignored, so entries relying on those never invalidate. MemoryStorage honours only Cache::All and silently drops every dependency; MemcachedStorage also throws NotSupportedException for Cache::Items.
{cache} in Latte
All arguments are optional, but the tag defaults to a 7-day expiration, unlike the PHP API which caches indefinitely. The block is invalidated automatically when the template file changes, and invalidating a nested block invalidates its parents.
Configuration
There is no `caching:` NEON section; the extension is named cache and takes no options at all. Everything is plain services:
FileStorage is the default and is the only source of cache-stampede protection: concurrent requests for a cold key block until the first has generated it. Swapping in DevNullStorage does not disable the Latte or DI container caches – they do not use nette/caching.
Documentation
The full Nette documentation for this topic is bundled with the plugin. Read a page when you need details beyond this skill:
- Caching – dependencies, journal, storages,
{cache} - Caching Upgrading – renamed constants and interfaces
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/nette/skills/nette-caching/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nette/agent-plugins/nette-caching)