Skip to content

Slim Framework HTTP cache middleware and service provider

License

Notifications You must be signed in to change notification settings

craveica/Slim-HttpCache

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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));

// Register service provider
$app->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 [email protected] instead of using the issue tracker.

Credits

License

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

About

Slim Framework HTTP cache middleware and service provider

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%