Download the PHP package hareland/multi-cache-remember without Composer
On this page you can find all versions of the php package hareland/multi-cache-remember. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hareland/multi-cache-remember
More information about hareland/multi-cache-remember
Files in hareland/multi-cache-remember
Package multi-cache-remember
Short Description This package offers the rememberMany macro for the Laravel Cache facade, providing efficient retrieval of multiple cache keys with customizable expiration and callbacks for missing keys.
License MIT
Informations about the package multi-cache-remember
What does this package solve?
This package offers the rememberMany macro for the Laravel Cache facade, providing efficient retrieval of multiple cache keys with customizable expiration and callbacks for missing keys.
The rememberMany macro for the Laravel Cache facade provides several advantages over the traditional method of looking up multiple cache keys one by one.
Why?
-
Reduced number of cache lookups: With the traditional method, each cache key is looked up individually, even if some of them are being retrieved in quick succession. With the rememberMany macro, all the requested keys are retrieved in a single call to Cache::many(), which can significantly reduce the number of cache lookups and improve performance.
-
Customizable cache expiration: The rememberMany macro allows you to specify an expiration time for all the cached values at once, which can simplify the cache management process and make it easier to ensure that your cached data is up-to-date.
- Callbacks for missing keys: The rememberMany macro allows you to specify a callback function for each cache key,
which will be called only if the key is not found in the cache. This is similar to the
Cache::remember()
method.
Install
Register ServiceProvider (if you must)
Usage
To set the default TTL, you can set this in
config/services.php
on the keymulti_remember.default_ttl
-> You will have to set it in seconds.