torann/taggable-file-cache

A Laravel file cache driver that supports tagging.
1,907 2
Install
composer require torann/taggable-file-cache
Latest Version:1.0.0
PHP:>=5.6
License:BSD-2-Clause
Last Updated:Feb 16, 2018
Links: GitHub  ·  Packagist
Maintainer: torann

Taggable File Cache

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.

Related Packages

qmagix/laravel-tagging

Use PHP traits to extend Laravel Eloquent Models to allow Tags. Models can be ma...

21 0
cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

744,044 570
waavi/tagging

Tags for Laravel 5 Eloquent models.

4,887 3
mmanos/laravel-taggable

A tagging package for Laravel 4 models.

41 5