Illuminate Cache

The Illuminate Cache component that powers Laravel's unified cache API

Library
Composer
vv13.26.1
129stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
51/100Fair
Development Activity52
Maintenance0
Community80
Maturity60
Momentum12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
86/100Excellent
Architecture88
Code Quality90
Innovation80
Learning Curve85

Illuminate Cache (illuminate/cache) is the caching component of the Laravel framework, distributed as a standalone Composer package via a read-only subtree split of laravel/framework. It provides a single, expressive API over many cache backends including Redis, Memcached, DynamoDB, database tables, the filesystem, in-memory arrays, and null stores, so application code can store and retrieve values without caring which driver is configured.

Beyond simple get/put access, the component ships atomic locks for coordinating work across processes, cache tagging for grouped invalidation, a rate limiter, and PSR-16 simple-cache compatibility. It can be used inside a full Laravel app or standalone in any PHP project that needs a robust, driver-agnostic cache.

What You Get

  • A CacheManager and Repository exposing a unified get/put/remember API
  • Drivers for Redis, Memcached, DynamoDB, database, file, array, and null stores
  • Atomic locks (RedisLock, DatabaseLock, FileLock, and more) for cross-process coordination
  • Cache tagging via TaggedCache and TagSet for grouped invalidation
  • A built-in RateLimiter and PSR-16 simple-cache compatibility

Common Use Cases

  • Caching expensive query results or computed values with remember()
  • Coordinating jobs and preventing race conditions using atomic locks
  • Rate limiting API requests or actions with the built-in limiter

Under The Hood

Architecture - The component is driver-based: CacheManager resolves named stores implementing a shared Store contract, and Repository wraps a store to provide the high-level API (get, put, remember, increment, tags). Concrete stores include RedisStore, MemcachedStore, DynamoDbStore, DatabaseStore, FileStore, ArrayStore, NullStore, and a MemoizedStore decorator. Atomic locking is implemented per driver via Lock subclasses, and tagging is layered on through TaggedCache/TagSet (with Redis-specific RedisTaggedCache). A CacheServiceProvider wires it into Laravel.

Tech Stack - Pure PHP targeting PHP 8.3+, depending only on other Illuminate components (collections, contracts, macroable, support). Optional drivers pull in ext-apcu, ext-memcached, illuminate/redis, illuminate/database, or symfony/cache as suggested dependencies, keeping the core lean.

Code Quality - As a first-party Laravel component maintained in laravel/framework, it is covered by the framework’s extensive test suite and continuous integration, with hundreds of contributors and a long history of production hardening. Naming follows Laravel conventions and the store/lock abstractions are cleanly separated.

API Design - The public API is famously ergonomic: Cache::remember($key, $ttl, $callback), Cache::lock($name)->get($callback), and tag-based invalidation read naturally. Official Laravel documentation covers every driver and feature, and sensible defaults mean most apps need only pick a store to get started.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search