torann / taggable-file-cache
A Laravel file cache driver that supports tagging.
Installs: 1 903
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 1
Requires
- php: >=5.6
- illuminate/support: ~5.4
Requires (Dev)
- mockery/mockery: 0.9.*
This package is auto-updated.
Last update: 2024-11-08 10:23:18 UTC
README
A Laravel file cache driver that supports tagging.
Installation
Composer
From the command line run:
$ composer require torann/taggable-file-cache
The Service Provider
Open up config/app.php
and find the providers
key.
'providers' => [ \Torann\TaggableFileCache\TaggableFileCacheServiceProvider::class, ]
Configuration
In your config\cache.php
, create a new store:
'tagged_file' => [
'driver' => 'tagged_file',
'path' => storage_path('framework/cache'),
]
Optional Configuration
queue
: accepts the string name of a queue to use during garbage collection, will use the default queue if omitted.separator
: defines the separator character or sequence to be used internally, this should be chosen to never collide with a key value (default~#~
)
Garbage Collection
To offset the work of cleaning up cache entries when a tag is flushed this task is added as a Job and queued using laravel's inbuilt queueing.
Note: laravel's default queue driver is
sync
which will result in the job being executed synchronously, it is strongly advised you use an alternate queue driver with appropriate workers to offset this work if you wish to use this cache driver.