berthott/laravel-api-cache is a Laravel package for laravel helper for caching api responses.
It currently has 0 GitHub stars and 1.090 downloads on Packagist (latest version 3.0.9).
Install it with composer require berthott/laravel-api-cache.
Discover more Laravel packages by berthott
or browse all Laravel packages to compare alternatives.
Last updated
A helper for caching complete API Responses. Easily cache the complete response of you Laravel API.
$ composer require berthott/laravel-api-cache
tablename.method).FlushesApiCache Trait to your model.
cacheDependencies method and return a list of related route names.FlushApiCache event listener is available to be connected with custom model events.To change the default options use
$ php artisan vendor:publish --provider="berthott\ApiCache\ApiCacheServiceProvider" --tag="config"
enabled: Enable the API caching. Default to env('CACHE_API', false).ignoreRoutes: An array of route names to be ignored from the cache. Defaults to [].lifetime: The lifetime of the cache in days. Defaults to 14.key: A key to add to each redis cache to be able to use a single redis server and avoid name clashes. Defaults toenv('CACHE_API_KEY', env('APP_NAME', 'laravel')).ApiCacheServiceApiCacheMiddleware intercepts all http requests and calls ApiCacheServiceFlushesApiCache trait observes creating / updating / deleting models and will clear the cache for the corresponding storeTested with Laravel 10.x.
See License File. Copyright © 2023 Jan Bladt.