Hi Christian Widlund, if you wish to just use If-None-Match in your application in the easiest way possible, I would recommend using the cache control middleware bundled with Laravel. One small difference using our package is the support for HEAD requests, the Laravel middleware uses this condition:
if (! $request->isMethodCacheable() || ! $response->getContent()) {
return $response;
}
In which the first condition will check if the request is either a GET or HEAD request, but the second condition will return false for HEAD requests as they don't return content.
The biggest difference however is simple the If-Match support. This is not included in the Laravel middleware at all. I suspect because it is almost impossible to make a "on size fits all" solution for If-Match, but our implementation should work for most common use cases.
This package will also keep getting updated and if possible, more conditional requests might get added.
Christian Widlund
Hergen Dillema what's the major differences with using werk365/etagconditionals vs. laravel built in cache-control-middleware? I didn't get that from the article 😊
laravel.com/docs/8.x/responses