Cache
Kona’s cache layer gives you a small, Laravel-shaped API for storing values by key with optional TTLs.
Quick start
Section titled “Quick start”val cache = CacheManager(config, basePath, redisManager).store()cache.put("answer", 42, 60)val value = cache.get("answer")val computed = cache.remember("profile", 120) { loadProfile() }Repository cache = new CacheManager(config, basePath, redisManager).store();cache.put("answer", 42, 60);Object value = cache.get("answer");Stores
Section titled “Stores”Configure cache.default and cache.stores.{name}.driver:
| Driver | Behavior |
|---|---|
array / memory |
Process-local map (great for tests) |
file |
JSON files under storage/framework/cache/data (or cache.stores.file.path) |
redis |
Uses RedisManager with cache.prefix |
Repository methods
Section titled “Repository methods”get/put/forever/forget/flushhas/missing/addremember/rememberForever/pull