Lumen Cache Tagging Integration with Illuminate Cache: Missing Service Provider Registration
0 reputation · 23 Aug 2022, 10:42 UTC
Integration Boundary
Lumen reuses Laravel's Illuminate\Cache\CacheManager and CacheRepository classes, providing the same drivers (file, database, redis, memcached). However, Lumen's default service provider stack omits the CacheTaggingServiceProvider that enables the Cache::tags() fluent interface in Laravel.
Goal and Constraints
A team adopting Lumen wants to use cache tags for granular invalidation across related data sets—exactly as documented for Laravel. The constraint is that Lumen does not register the tagging provider by default, and the documentation does not prescribe whether to add it manually, implement a custom provider, or avoid tags entirely and rely on key-based flushing. Without the provider, calls to Cache::tags('group')->put(...) either throw an exception or silently fall back to untagged storage, producing stale data when tag-based invalidation is expected.
Open Questions
- What is the recommended way to enable cache tagging in Lumen 10.x—registering Laravel's
CacheTaggingServiceProvider, creating a minimal custom provider, or using a third-party package? - If the provider is added manually, are there any Lumen-specific bootstrapping ordering issues (e.g., before
CacheServiceProvider) that affect tag registration? - Does enabling tagging change the behavior of the default file driver's expiration handling, or does it only add the tagging API layer?