New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

mintbridge/laravel-cache-filter

Laravel route filter for caching responses
22 2
Install
composer require mintbridge/laravel-cache-filter
Latest Version:1.0.0
PHP:>=5.3.0
Laravel:4
License:MIT
Last Updated:Jun 15, 2014
Links: GitHub  ·  Packagist
Maintainer: mintbridge

Laravel Cache Filter

Often you have responses that don't change very often, this package lets you store these responses in the cache and then return them automatically using a filter the next time they are requested.

Installation

Begin by installing this package through Composer.

{
    "require": {
		"mintbridge/laravel-cache-filter": "1.0.x"
	}
}

Then add the service provider to you app config.


// app/config/app.php

'providers' => [
    '...',
    'MintBridge\LaravelCacheFilter\LaravelCacheFilterServiceProvider'
];

Usage

The package provide 2 filters, these can be used with Laravels before and after route filters:

Route::get('some-route', array(
	'before' => 'cache.response.fetch',
	'after' => 'cache.response.store',
	...
));

The fetch filter will check to see if the response has been cached and if so return it. The store filter takes the generated response and adds it to the cache ready for the next time it is requested.

Related Packages

themonkeys/blade-cache-filter

A simple caching filter that caches Laravel's Response objects

965 5
bunkuris/has-cache

HasCache trait for Laravel models with cache key managers

3,582 0
silber/page-cache

Caches responses as static files on disk for lightning fast page loads.

522,933 1,261
mjarestad/filtry

Filter and sanitize input data in Laravel 4/5 or as a standalone package.

230,344 13
daveismyname/laravel-filters

Save and reuse query string based filters

63,590 9

Version History

Version Released PHP Laravel License
1.0.0 >=5.3.0 4.1.* MIT