divtag / laravel-etag
Laravel Etag
Installs: 2 211
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- php: ^7.0|^8.0
- illuminate/http: 5.5.*|5.6.*|5.7.*|5.8.*|6.*|7.*|8.*
- mockery/mockery: 1.*
Requires (Dev)
- phpunit/phpunit: ^6.0|^7.0
This package is not auto-updated.
Last update: 2023-10-18 06:48:20 UTC
README
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.