torann/taggable-file-cache

A Laravel file cache driver that supports tagging.

1.0.0 2018-02-16 15:57 UTC

This package is auto-updated.

Last update: 2024-11-08 10:23:18 UTC


README

Latest Stable Version Total Downloads

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.