Download the PHP package tequilarapido/result-cache without Composer
On this page you can find all versions of the php package tequilarapido/result-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tequilarapido/result-cache
More information about tequilarapido/result-cache
Files in tequilarapido/result-cache
Package result-cache
Short Description A simple and decoupled way to store resource consuming operations results in cache.
License MIT
Homepage https://github.com/tequilarapido/result-cache
Informations about the package result-cache
A simple and decoupled way to store resource consuming operations results in cache.
Contents
- Installation
- Usage
- Changelog
- Testing
- Security
- Contributing
- Credits
- License
Installation
You can install the package using composer
Usage
Cache
-
Create a class that extends ResultCache
-
Now you can simply call the get method to fetch cache. If the cache is invalid or not yet created, the operations will be executed.
- Clean the cache
The package uses the default cache driver defined in your laravel application.
You can clean the cache using the artisan cache:clear
You can also clean the cache programmatically using :
Application locale aware cache
Sometimes we need to cache something, but we need multiple versions depending on the application locale.
For this kind of use case we need to extend the LocaleAwareResultCache
, and define the locales that are available in our application.
-
Create a class that extends LocaleAwareResultCache
-
Now you can simply call the get method to fetch cache. If the cache is invalid or not yet created, the operations will be executed.
- Clean the cache
The package uses the default cache driver defined in your laravel application.
You can clean the cache using the artisan cache:clear
You can also clean the cache programmatically using :
this will clean cache for all locales.
Cache expiration
By default, cache is created for one day. You can override the protected $minutes
property on
your cache class to specify how much minutes you want your cache before it gets invalidated.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Security
If you discover any security related issues, please email :author_email instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
- Nassif Bourguig
- All Contributors
License
The MIT License (MIT). Please see License File for more information.