Backend developer from the Netherlands, working with Laravel, PHP, Go and building micro services
Nothing here yet.
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.
As this blogpost purely describes the backend implementation it is therefor frontend agnostic. In theory you could use this in your backend for any front end you want. I would say caching mechanisms like this are especially valuable for mobile applications, where (especially in some countries) every bit of data might cost your user money if they use mobile data.