Lumen File Cache Driver
I'm in Lumen, inside a Controller, and I would like to cache a computation's result in a simple and easy way, without using database or external services, so I was looking for save the cache in the filesystem. In Laravel's documentation there is cited the
By default, Laravel is configured to use the file cache driver, which stores the serialized, cached objects in the filesystem.
And I can see it, configured as Default Cache Store, inside
In Lumen's documentation i can't see anything about the file driver and I find nothing like the file
cache.php inside Lumen installation.
So my question is if I can use the file cache driver in Lumen (by setting
CACHE_DRIVER=file) or if it is discouraged, not supported, not implemented or something else?
In Lumen in
.env.example you have by default:
So all you need is to change filename from
.env and set
If you read Caching in Lumen you'll see in example:
$value = Cache::store('file')->get('foo');
file driver is supported by Lumen.
If you also read Lumen Configuration you can read here that you can copy configuration files you need (in case you need them) and load them manually. You can see default Luman cache config file here: https://github.com/laravel/lumen-framework/blob/5.1/config/cache.php
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms