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
Laravel Multi Cache

Laravel Multi Cache Laravel Package

rapidez/laravel-multi-cache

A Laravel cache driver that lets you use multiple cache stores at once. Read from and write to several backends together, making it easy to migrate caches, add redundancy, or combine fast local and shared stores without changing your application code.

Deep Wiki
Context7

Laravel Multi Cache lets you fan out a single cache operation to several Laravel cache stores at once. Define a multi store in config/cache.php that combines existing drivers, write to all of them, and read from the first store that contains the key — ideal for layering a fast in-memory cache in front of a persistent backend.

  • Combine any number of existing cache stores into one logical store
  • Writes propagate to every backing store; reads fall back in priority order
  • Works with the standard Cache facade, tags and atomic locks
  • Configured entirely through config/cache.php
  • Drop-in replacement — no application code changes required
Frequently asked questions about Laravel Multi Cache
What is rapidez/laravel-multi-cache used for?
Laravel Multi Cache lets you register named caches that combine multiple Laravel cache stores, so different parts of your application can use different drivers through one familiar cache API. It is useful when you want one logical cache to span stores, such as a fast local store plus a persistent shared store. You still configure the underlying Laravel cache stores normally.
How do I install rapidez/laravel-multi-cache?
Install it with Composer by running composer require rapidez/laravel-multi-cache. Laravel package auto-discovery should register the service provider; if your application disables discovery, register the provider manually. Then publish or edit the package configuration and define your named multi-cache stores.
How do I configure multiple cache stores with Laravel Multi Cache?
Define named caches in the package configuration and map each one to the underlying Laravel cache stores you want it to use. After that, select the named cache with Laravel's normal cache store syntax or the package's documented API. Keep your underlying store definitions in Laravel's cache configuration as usual.
Can Laravel Multi Cache read and write to multiple stores at once?
Yes. A configured multi-cache can read from and write to its underlying stores using Laravel's familiar cache methods. The exact read order and write behavior depend on the package configuration, so check the documentation for how you want misses and writes handled across stores. This lets one logical cache operation span multiple drivers.
How does Laravel Multi Cache handle TTL and expiration?
TTLs are passed through the familiar Laravel cache API, such as put and remember, and are applied to the configured stores. Expiration behavior therefore follows Laravel's cache repository rules for each underlying driver. If stores have different eviction policies, account for that in your design.
Which Laravel versions and cache drivers does Laravel Multi Cache support?
The package targets Laravel's cache system and works with Laravel cache stores rather than replacing them. Exact Laravel version constraints and tested drivers are listed in the package's composer.json and documentation. Verify your Laravel version and driver compatibility before adopting it.
Is Laravel Multi Cache safe for production?
It can be used in production when the underlying stores are reliable and you understand the trade-offs of writing to multiple backends. Multi-store writes can add latency and partial-failure scenarios, so monitor cache operations and decide how strict consistency needs to be. For critical data, keep a database source of truth rather than relying on cache alone.
How do I test Laravel Multi Cache in my application?
Use Laravel's normal testing tools and configure array or fake cache stores for the underlying drivers. Then assert that your named multi-cache reads and writes behave as expected, including TTL and fallback behavior. Avoid hitting real Redis or Memcached instances in unit tests.
What are alternatives to Laravel Multi Cache?
Laravel already lets you define multiple cache stores and choose one explicitly with the cache store API. Laravel Multi Cache is for grouping stores behind one named cache when you need read and write behavior across them. Alternatives include custom cache repositories or application-level logic that calls several stores directly.
How do I keep Laravel Multi Cache up to date?
Check Packagist and the package repository for releases, changelogs, and Laravel compatibility updates. Because it integrates with Laravel's cache contracts, retest after Laravel major upgrades and cache driver changes. Pin a compatible version in Composer and review release notes before upgrading.
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.
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
uni-method/symfony-lib