cache/prefixed-cache
Decorates any PSR-6 or PSR-16 cache so every key automatically carries a fixed prefix. PrefixedCachePool::create() also supports native tags, and prefixes are safely encoded before joining to keys.
tenant_42:, staging:, module_billing:), reducing collision and cross-tenant leakage risk.CacheItemPoolInterface and need a consistent static prefix on every key.prefix configuration, Cache::store(), or a Laravel-specific wrapper rather than adding an adapter just for this package.For executives: “We can isolate cache namespaces per tenant, app, or environment by wrapping existing PSR-6 cache pools with a small MIT-licensed decorator. That supports sharing Redis or Memcached infrastructure without key collisions and avoids dedicated cache instances for every tenant or module. It is a tactical cost and isolation lever, not a strategic caching platform. Because adoption is very low and Laravel integration requires validation, I recommend a limited pilot on a non-critical cache store. If it proves useful, we either vendor/fork the tiny codebase or implement the equivalent pattern in-house. No license cost; main risk is dependency maintenance and integration fit.”
For engineering: “PrefixedCachePool decorates any PSR-6 pool and prepends a static prefix to all keys. Use it when you already have a PSR-6 pool and need namespaces such as tenant_1:, feature_x:, or env_staging:. Pros: tiny, PSR-6-compliant, non-invasive. Cons: not Laravel-native, no tagging/hierarchy, static prefix only, and very low adoption. Integration should start with a spike using php-cache/redis-cache or the actual pool in use; wrap it via a service provider or custom cache store only after proving compatibility. Define prefix ownership, length limits, migration and invalidation behavior first. Recommendation: prototype only if PSR-6 is already in the stack; otherwise use Laravel’s native cache prefixing or build a small internal decorator.”
How can I help you explore Laravel packages today?