lostisland / faraday_middleware

Various Faraday middlewares for Faraday-based API wrappers
MIT License
556 stars 205 forks source link

Use full URL (url.host + url.request_uri) as cache key #195

Closed vmanivchuk closed 4 years ago

olleolleolle commented 4 years ago

The "full key" form disambiguates, which is better.

(Keeping the old form around for compatibility - is it necessary, in your opinion? I think it may not be necessary.)

@technoweenie How did this work before? Did site_a.com/path and site-b.com/path return the same cached content? (That's my understanding from this diff.) If yes, then let's apply this immediately. ❤️ 🌴

vmanivchuk commented 4 years ago

Keeping the old form for compatibility is necessary because there can be issue with key length. And yes, site_a.com/path and site-b.com/path return the same cached content.

olleolleolle commented 4 years ago

Would it be acceptable to switch over to this new behavior in an upcoming major version? Update: Ah, keys can be too long for one's cache implementation, yeeees. Thanks for clarifying.

vmanivchuk commented 4 years ago

Yes, of course.

iMacTia commented 4 years ago

Wanted to include this in last 0.1x release as it's a pretty good point!