Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Hybrid Cache

Hybrid Cache Laravel Package

rajmundtoth0/hybrid-cache

A Laravel package that adds a hybrid cache layer, combining fast in-memory storage with persistent backends to reduce latency and database load. It offers simple cache APIs and configurable drivers for scalable PHP applications.

View on GitHub
Deep Wiki
Context7

Laravel hybrid cache with local + distributed layers and stale-while-revalidate (SWR) semantics.

Frequently asked questions about Hybrid Cache
What does rajmundtoth0/hybrid-cache do in a Laravel app?
It adds a two-tier cache store for Laravel: a fast local in-process layer in front of a persistent shared backend, exposed through Laravel's standard Cache API. You configure primary and fallback stores, and reads fall back automatically on a miss or failure. It is aimed at read-heavy paths where shared-store round trips dominate latency.
How do I install and configure hybrid-cache in Laravel?
Install with Composer, then publish the package's configuration and add a new store entry under config/cache.php. The package supports Laravel auto-discovery, so manual service provider registration is typically not needed. Keep your existing cache store and introduce hybrid-cache as an additional named store first.
Which Laravel versions does hybrid-cache support?
Release 0.2.0 targets Laravel 13, so applications on Laravel 11 or 12 must either pin 0.1.0 or upgrade the framework. The package does not document a broad multi-version support policy. Treat mixed-version estates as separate adoption decisions.
How does the primary and fallback store behavior work?
The package pairs a primary store with a fallback store and automatically falls back on cache misses or failures. That makes the fast local layer the first read path while the shared backend keeps data available across processes. It is not a write-through replication system, so verify TTL settings for both tiers.
Does hybrid-cache work with Laravel's Cache facade, TTLs, and Cache::touch?
Yes. It integrates with Laravel's cache system and uses the existing Cache facade and TTLs, and 0.2.0 adds touch support so Cache::touch() calls can extend TTL without rewriting the payload. That enables sliding-expiration and refresh-on-read patterns. Confirm behavior on your chosen backing store before relying on it.
What are the consistency and staleness risks of a two-tier cache?
Writes to the shared backend do not evict other workers' in-process copies, so the effective staleness window is the local TTL. That window can be invisible to the application. Avoid hybrid-cache for tight write-then-read consistency paths such as permissions or login flows.
Is the in-process local cache bounded, and how does it behave under Octane?
The package overview does not document a maximum entry count, memory cap, or eviction policy for the local layer. Under Octane or FrankenPHP, an in-process cache may persist for the lifetime of a worker, which changes its effective lifetime. Ask the maintainer how that layer is bounded before production use.
Does hybrid-cache support cache tags, atomic locks, or increment and decrement?
The available documentation does not confirm support for cache tags, atomic locks, or increment and decrement. Any call site using Cache::tags() cannot move to this store unless tag support is verified. Inventory those usages before routing key families to hybrid-cache.
How should I roll out hybrid-cache in production without replacing Redis?
Introduce it as an additional named store and route only low-risk, read-mostly key families to it, keeping Redis or your database store for everything else. Start with sliding-expiration keys that benefit from touch support and measure latency and staleness impact in isolation. Rollback is a config change if you do not use it as a queue or session driver.
What alternatives or maintenance concerns should I consider before adopting hybrid-cache?
The package is at 0.2.0 with a single maintainer and no stated support policy, so maintenance risk is a real consideration. Alternatives include a plain Redis store, Laravel's database cache, or a custom two-tier repository. Ask about Laravel 12 security fixes, invalidation mechanisms, and backing-store compatibility before adopting.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment