divtag/laravel-etag

This package is abandoned and no longer maintained. No replacement package was suggested.

Laravel Etag

v1.1.4 2021-03-03 14:26 UTC

This package is not auto-updated.

Last update: 2023-10-18 06:48:20 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

This package provides a middleware which can automatically generate and add an ETag header to responses and respond with a 304 Not Modified response when needed.

Installation

You can install the package via composer:

composer require divtag/laravel-etag

Usage

When you assign the middlware to a route the package will take care of generating the ETag header and responding with a 304 Not Modified response when needed.

Route::get('/', function () {
    return view('welcome');
})->middleware('etag');

You can still take care of generating the ETag header in your own code. When an ETag header is already attached to the response, the package will skip generating the ETag and just handle the responding with a 304 Not Modified response when needed.

Route::get('/', function () {
    return response('foobar')
        ->header('ETag', 'W/"foobar"');
})->middleware('etag');

Testing

composer test

Security

If you discover any security related issues, please email machiel@divtag.nl instead of using the issue tracker.

Credits

About us

Divtag is a digital agency based in Drunen, the Netherlands. As part of MPO Ventures we are working day in, day out at very exciting projects and products. Having any questions about our services or open vacancies? Feel free to contact us.

License

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