I did that to prevent setting cache with the response, that was taken from the cache. Now when we do request with cache on, it goes like this:

1. Make request
2. Send request to the server
3. Set cache
4. Do another request to the same url
5. We get request from cache
6. We set the cache with the response that was taken from cache just now.

I think point 6 is wrong, why set cache with the same response that we just get from it ? In my case i wrote simple cache class that respects cache_ttl. When I set new cache, I also store current time. When cached response is older that cache_ttl, it gets cleared from cache, and the new request is sent. From example I got cache_ttl = 5 for some url, and cache_ttl = 1 for other, but I do request 1 per second. In that cache every second i set new cache for url with cache_ttl = 5, and it newer gets old, because its being set each second as the new request. With that change i prevent setting cache if we get reponse from cache. I could handle it in my own class, with the .cached? method added, but I think maybe it should be handled at higher level ?