jdavidbakr / laravel-cache-garbage-collector
A script that will clean up expired cache files if the system is using the files cache system
Installs: 116 942
Dependents: 0
Suggesters: 0
Security: 0
Stars: 56
Watchers: 1
Forks: 8
Open Issues: 0
Requires
- php: >=7.1.0
- illuminate/support: 8.*|9.*|10.*|^11.0
- mockery/mockery: ^1.3
Requires (Dev)
- orchestra/testbench: 6.*|7.*|8.*|^9.0
- phpunit/phpunit: 9.*|10.*
- squizlabs/php_codesniffer: ~2.3|^3.9
This package is auto-updated.
Last update: 2024-12-06 14:35:00 UTC
README
When using the file cache driver, Laravel creates the cache files but never purges expired ones. This can lead to a situation where you have a large number of unused and irrelevant cache files, especially if you do a lot of short-term caching in your system.
This package creates an artisan command cache:gc that will garbage-collect your cache files, removing any that have expired. You may run this manually or include it in a schedule.
Thanks to TerrePorter for his suggestion on laravel.io!
Install
Via Composer
$ composer require jdavidbakr/laravel-cache-garbage-collector
Then add the service provider to app/Console/Kernel.php
in the $commands array:
\jdavidbakr\LaravelCacheGarbageCollector\LaravelCacheGarbageCollector::class
Usage
$ php artisan cache:gc
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email me@jdavidbaker.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.