---
title: "Comment by Christian Widlund on \"Caching your Laravel API with ETag and Conditional Requests\" | Hashnode"
description: "Hergen Dillema what&#39;s the major differences with using werk365/etagconditionals vs. laravel built in cache-control-middleware? I didn&#39;t get that from th"
url: "https://hashnode.com/posts/caching-your-laravel-api-with-etag-and-conditional-requests/60306105f51caf4448561656/comment/607160c41494367be6d29909"
---

[Discussion](https://hashnode.com/posts/caching-your-laravel-api-with-etag-and-conditional-requests/60306105f51caf4448561656)

Comment [Caching your Laravel API with ETag and Conditional Requests](https://hashnode.com/posts/caching-your-laravel-api-with-etag-and-conditional-requests/60306105f51caf4448561656)

[Christian Widlund](https://hashnode.com/@chrillep)

[Apr 10, 2021](https://hashnode.com/posts/caching-your-laravel-api-with-etag-and-conditional-requests/60306105f51caf4448561656/comment/607160c41494367be6d29909)

[Hergen Dillema](https://hashnode.com/@Hergen) 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](https://laravel.com/docs/8.x/responses#cache-control-middleware)

[Hergen Dillema](https://hashnode.com/@Hergen)

[Apr 10, 2021](https://hashnode.com/posts/caching-your-laravel-api-with-etag-and-conditional-requests/60306105f51caf4448561656/comment/607160c41494367be6d29909#reply-6071ce4a8b2b857c0bdb5fe0)

Hi [Christian Widlund](https://hashnode.com/@chrillep), 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](https://hashnode.com/@chrillep)

[Apr 11, 2021](https://hashnode.com/posts/caching-your-laravel-api-with-etag-and-conditional-requests/60306105f51caf4448561656/comment/607160c41494367be6d29909#reply-6073007f8b2b857c0bdb6dea)

[Hergen Dillema](https://hashnode.com/@Hergen)

thank you for the in depth explanation! your package looks more useful. I'll try it out 😊.
