NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1418 most downloaded on Packagist
⚡ Nette Caching: a cache with an easy API and smart invalidation by expiration, tags, priorities or file changes. Storages for files, SQLite, Memcached, Redis and memory.
Latest stable
v4.0.0
Last release 16 days ago
06 Nov 2026
Ships fairly regularly
a new release about every 6 months
Most releases are documented
notes for 40 of 49 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
49 releases · first in 2014
Drag across the ruler to compare, or tap a release to open it.
Cache::save() with a closure is deprecated, pass the closure to load() as the generator
Two new storages, a lock that really prevents cache stampede, and an API in which a mistake in dependencies or invalidation fails loudly instead of quietly leaving stale data in the cache.
$lockTimeout)PsrCacheAdapter keeps covering the opposite directionnew Dependencies(expire: '20 minutes', tags: [...]), or type the generator's parameter as Dependencies $dp and write $dp->expire = '20 minutes'; the array with Cache::* keys still works$cache->clean(tags: ["article/$id"]), priority: 100 or all: trueLockingReader interfaceExpire, Sliding, Tags, Priority and cleaning by namespace, which makes it a realistic stand-in in tests (#85)load(), bulkLoad() and call() to their caller (#87){cache} tag, Latte 3.1Storage::lock() is gone; a custom storage that should generate a missing item in one process at a time implements LockingReader::readOrGenerate(). Cache::save() with a closure is deprecated, pass the closure to load() as the generatorclean() throws an exception, and so does clean() without any condition; expired items are removed by $storage->clean([])clean(all: true) on a cache with a namespace removes only that namespace and the ones derived from it; a cache without a namespace still clears the whole storage. Cleaning by Cache::Namespaces includes the derived namespaces as wellNotSupportedException for a dependency or condition it cannot honor, such as Priority in SQLiteStorage or cleaning by namespace in MemcachedStoragePsrCacheAdapter validates keys as PSR-16 requires, so user:1 and other keys with {}()/\@: are rejectedIStorage, IJournal and IBulkReader and the service aliases cacheStorage and nette.cacheJournal are removed; the UPPERCASE constants such as Cache::EXPIRE and Cache::start() trigger a deprecation noticeThe complete list with migration hints is in docs/upgrading.md.
PsrCacheAdapter::getMultiple() reads all the keys in one bulk requestYour coding agent can read these notes before it upgrades. Set up the MCP server →
SQLiteStorage now cleans up after itself – expired items are removed by probabilistic garbage collection, just like in FileStorage
Items dependency on an item that is being generated at the same moment no longer hangs the process (#54)bulkRead() works with any number of keys, regardless of the SQLite limit of query parametersDateInterval TTL is converted independently of the timezoneSliding without Expire like the other storages, and SQLite transactions are rolled back on failureA housekeeping release focused on code quality: every class and method now carries clearer, more descriptive PHPDoc, type hints got sharper (both nati
A housekeeping release focused on code quality: every class and method now carries clearer, more descriptive PHPDoc, type hints got sharper (both native and annotated), and static analysis is now a mandatory part of CI with the official Nette PHPStan rules. No API changes – just a tidier, better-typed codebase.
Nothing published for this version
optimized global function calls
added PSR-16 adapter ( #77 ) support for PHP 8.4
CacheExtension: accepts complete path (BC break)
support for PHP 8.3
added $dependencies as a Cache::load() 3rd parameter
SQLiteJournal: speed up cache writing, prevent database locked error
support for Latte 3 coding style
Nothing published for this version
Nothing published for this version
~~Cache::save() with closure is deprecated (BC break)~~
CacheMacro: wrapped in try ... finally
rollback()For the details you can have a look at the diff.
For the details you can have a look at the diff.
For the details you can have a look at the diff.
uses PHP 7.1 scalar and return type hints
For the details you can have a look at the diff.
For the details you can have a look at the diff.
fixed compatiblity with nette/object 2.5
For the details you can have a look at the diff.
Nothing published for this version
Revert "SQLiteJournal: checking for extension pdo_sqlite is lazy, service cache.journal is created always"
This reverts commit 7212326, it can lead to unexpected error 500 when GC is started.
For the details you can have a look at the diff.
added Cache::NAMESPACES and support for cleaning namespace in FileStorage #52
For the details you can have a look at the diff.
coding style: fixes, lowercase true/false/null
For the details you can have a look at the diff.
Cache: do not save data with negative/zero expiration
For the details you can have a look at the diff.
Cache: TAGS in dependencies are converted to array list #46
For the details you can have a look at the diff.
SQLiteJournal: checking for extension pdo_sqlite is lazy, service cache.journal is created always
For the details you can have a look at the diff.
removed FileJournal _(note that successor SQLiteJournal requires pdo-sqlite extension)_
For the details you can have a look at the diff.
Cache: TAGS in dependencies are converted to array list #46
For the details you can have a look at the diff.
SQLiteJournal: filesystem permissions like ordinary file #29
For the details you can have a look at the diff.
SQLiteJournal: lazy initialization
For the details you can have a look at the diff.
added NewMemcachedStorage using memcached extension #38
For the details you can have a look at the diff.
SQLiteJournal: optimizations #34
save() handles Throwable errorsFor the details you can have a look at the diff.
SQLite: Removed connection persistence.
For the details you can have a look at the diff.
SQLiteJournal: Atomic operations added back [Rel #25]
For the details you can have a look at the diff.
CacheExtension: default journal changed to SQLiteJournal
added NewMemcachedStorage using memcached extension #38
For the details you can have a look at the diff.
Cache: fixed deadlock when exception is thrown in fallback #36
save() handles Throwable errorsFor the details you can have a look at the diff.
travis: migrating to container-based infrastructure
For the details you can have a look at the diff.
Nothing published for this version
Nothing published for this version
ancient and deprecated ArrayAccess syntax $val = $cache[$key] or $cache[$key] = $val triggers E_USER_DEPRECATED. Use please $cache->load($key) and $ca…
FileStorage: removed usage of realpath()$val = $cache[$key] or $cache[$key] = $val triggers E_USER_DEPRECATED. Use please $cache->load($key) and $cache->save($key, $val)Cache: fixed deadlock when exception is thrown in fallback #36
For the details you can have a look at the diff.
travis: migrating to container-based infrastructure
For the details you can have a look at the diff.
Nothing published for this version
Nothing published for this version
MemcachedStorage: the key must not include control characters or whitespace [Closes #13]
For the details you can have a look at the diff.
SQLiteStorage: fixed clean(Cache::ALL)
clean(Cache::ALL)For the details you can have a look at the diff.
Nothing published for this version
The first standalone release. For more information see readme.md.
The first standalone release. For more information see readme.md.
One column per quarter.