desmart / laravel-cache-protract
File based cache prolonger for Laravel
Requires
- illuminate/cache: ~4.1.0
Requires (Dev)
- illuminate/filesystem: ~4.1.0
- phpspec/phpspec: ~2.1.0@dev
- squizlabs/php_codesniffer: @stable
This package is auto-updated.
Last update: 2022-02-01 12:42:02 UTC
README
laravel-cache-protract
File based cache prolonger for Laravel.
Background
Laravel's file cache is rather simple. When it's expired the cache file is removed. Depending on implementation this cache gets regenerated during the request.
On heavy loaded applications this means that during the time of regeneration every request bumps into empty cache file and tries to regenerate it. This gap can lead to DoS - application will stop to respond.
This package is meant to lower the risk of that. Request hits expired cache, prolongs its expiration and in the meantime tries to regenerate the cache. For the time of regeneration other threads will get old contents.
Installation
composer require desmart/laravel-cache-protract:~1.0.0
In app/config/app.php
add DeSmart\CacheProtract\ServiceProvider
to providers.
In app/config/cache.php
change driver to file-protract
.
Optionally you can publish, and change config file.