PHP Classes

File: libraries/vendor/slim/http-cache/README.md

Recommend this page to a friend!
  Classes of Duong Huynh Nghia   PHP Slim Framework 3 Modular Application   libraries/vendor/slim/http-cache/README.md   Download  
File: libraries/vendor/slim/http-cache/README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Slim Framework 3 Modular Application
Create modular applications using Slim Framework
Author: By
Last change:
Date: 7 years ago
Size: 1,247 bytes
 

Contents

Class file image Download

Slim Framework HTTP Cache

Build Status

This repository contains a Slim Framework HTTP cache middleware and service provider.

Install

Via Composer

$ composer require slim/http-cache

Requires Slim 3.0.0 or newer.

Usage

$app = new \Slim\App();

// Register middleware
$app->add(new \Slim\HttpCache\Cache('public', 86400));

// Fetch DI Container
$container = $app->getContainer();

// Register service provider
$container->register(new \Slim\HttpCache\CacheProvider);

// Example route with ETag header
$app->get('/foo', function ($req, $res, $args) {
    $resWithEtag = $this['cache']->withEtag($res, 'abc');

    return $resWithEtag;
});

$app->run();

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@slimframework.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.