https://github.com/zamronypj/zzzmiddleware
Cache middleware for Slim Framework 3.0
https://github.com/zamronypj/zzzmiddleware
cache-library php slim-3 slim-framework slim-middleware zzzcache
Last synced: 5 months ago
JSON representation
Cache middleware for Slim Framework 3.0
- Host: GitHub
- URL: https://github.com/zamronypj/zzzmiddleware
- Owner: zamronypj
- License: apache-2.0
- Created: 2018-04-08T14:15:23.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-09T23:36:30.000Z (almost 8 years ago)
- Last Synced: 2026-01-14T14:44:48.969Z (5 months ago)
- Topics: cache-library, php, slim-3, slim-framework, slim-middleware, zzzcache
- Language: PHP
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zzzmiddleware
Cache middleware for Slim Framework 3.0 using ZzzCache
# Requirement
- [PHP >= 5.4](https://php.net)
- [Composer](https://getcomposer.org)
- [Slim Framework 3.0](https://slimframework.com)
- [ZzzCache](https://github/zamronypj/zzzcache)
# Installation
Run through composer
$ composer require juhara/zzzmiddleware
# How to use
### Register CacheMiddleware to Slim Dependency Container
get(CacheInterface::class);
$factory = new ResponseCacheFactory();
return new CacheMiddleware($cache, $factory);
};
### Add CacheMiddleware to Slim Application
use Slim\App;
use Juhara\CacheMiddleware\CacheMiddleware;
$app = new App($settings);
...
$app->add(CacheMiddleware::class);
### Create Proper Configuration
If using `Juhara\ZzzCache\Storages\File` as storage, then you need to make sure
that directory of cache is writeable by web server.
## Example
See [example application](https://github.com/zamronypj/zzzappexample) to understand
how to use CacheMiddleware.
## Contributing
Just create PR if you want to improve it.
Thank you.