New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

aranw/etags-middleware

ETags HttpKernelInterface Middleware
10,282 8
Install
composer require aranw/etags-middleware
Latest Version:v0.4.0
PHP:>=5.4.0
Laravel:4
License:MIT
Last Updated:Feb 12, 2015
Links: GitHub  ·  Packagist
Maintainer: aranw

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

Related Packages

barryvdh/laravel-stack-middleware

Stack Middleware for Laravel

431,328 41
winglian/middleware-adapter

Adapter for HttpKernelInterface middlewares to be used with Laravel

23 1
matthewbdaly/laravel-etag-middleware

A Laravel middleware for adding ETags to HTTP requests to improve response times

338,611 64
mmaalouly/laravel-etag-middleware

A Laravel middleware for adding ETags to HTTP requests to improve response times

1,263 0
shin1x1/laravel-force-https-url-scheme

Force https url schema middleware for Laravel 5

26,582 25

Version History

Version Released PHP Laravel License
v0.4.0 >=5.4.0 4.2.* MIT
v0.3.0 >=5.3.0 4.1.* MIT
v0.2.0 >=5.3.0 4.1.* MIT
v0.1.0 >=5.3.0 4.1.* MIT