nette-cachinglisted
Install: claude install-skill nette/agent-plugins
## Nette Caching
```shell
composer require 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.
```php
Cache::Expire // 'expire' – NOT Cache::Expiration (that constant does not exist)
Cache::Sliding // 'sliding'
Cache::Tags // 'tags'
Cache::Files // 'files' – resolved with filemtime(), so a relative path depends on the CWD; use absolute
Cache::Items // 'items' – other cache keys
Cache::Constants // 'consts'
Cache::Callbacks // 'callbacks' – [callable, ...args], must return true to stay valid.
// The callable is SERIALIZED with the entry, so a closure is
// a fatal ("Serialization of 'Closure' is not allowed") –
// use a function name or [Class::class, 'method'].
Cache::Priority // 'priority'
Cache::All // 'all' – clean() only
```
`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
```php
$cache = new Nette\Caching\Cache($storage, 'my-namespace'); // Nette\Caching\Storage is autowired
$sub = $cache->derive('images');