Skip to content

A HttpKernelInterface middleware for adding ETag headers based on response content. This package should work with StackPHP HttpKernelInterface Frameworks.

License

Notifications You must be signed in to change notification settings

aranw/etags-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

etags-middleware

A HttpKernelInterface middleware for adding ETag headers based on response content. This package should work with StackPHP HttpKernelInterface Frameworks.

Install

Via Composer

{
    "require": {
        "aranw/etags-middleware": "dev-master"
    }
}

Example

Silex example

<?php

$app = new Silex\Application();

$app->get('/', function () {
    return 'Hello World';
});

$stack = new Stack\Builder();
$stack->push('Aranw\ETagsMiddleware\ETags');

$app = $stack->resolve($app);

Usage

Currently you can either install this using the provided Laravel Service Provider or by using the StackPHP's Builder class like the example above.

Todo

This is still in its earliest stages of development, and below is a list of issues that still need resolving:

  • Add tests
  • Explore usage of Last-Modified header and how it can be added to work in this package and how it affects the ETag header
  • Add more service providers for other frameworks
  • Expore usage of custom options to provide ability to exclude or include URLs, or URL Regex Patterns

Inspiration

Inspiration from rack etag middleware

About

A HttpKernelInterface middleware for adding ETag headers based on response content. This package should work with StackPHP HttpKernelInterface Frameworks.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages