moafak / laravel-weak-etag-middleware
A Laravel middleware to add weak etags to HTTP response headers
Requires
- illuminate/http: 5.1.x|5.2.x|5.3.x|5.4.x|5.5.x|5.6.x
- illuminate/support: 5.1.x|5.2.x|5.3.x|5.4.x|5.5.x|5.6.x
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^4.8|^5.2
- satooshi/php-coveralls: ^1.0
This package is not auto-updated.
Last update: 2023-06-30 15:02:05 UTC
README
A Laravel middleware for adding Weak ETags to HTTP requests to improve response times
Weak Etag vs Strong Etag
Etag is a digest of the response content, usually with a hashing function.
Strong etag means the content of the response is byte-for-byte identical.
While weak etag means the content is symantically identical.
Example of strong etag: "f9bba821aec5e6b4607597cb500898f7"
Example of weak etag: W/"f9bba821aec5e6b4607597cb500898f7"
Refer to the blog post for more info.
Installation
Run the following command to install the package:
composer require moafak/laravel-weak-etag-middleware
Then just include this in your app/Http/Kernel.php
in the appropriate place where you want to import the middleware:
\moafak\WeakETagMiddleware\WeakETag::class