httpcache icon indicating copy to clipboard operation
httpcache copied to clipboard

Cache Key should contain more than just the HTTP Method

Open martinei opened this issue 4 years ago • 1 comments

The library uses a Cache Key composed out of the Request Method and http.Request.RequestURI. However "RequestURI" is a server only field and is empty on client side. Thus all GET Request share the same cache key. ("GET "). As a result this library is basically is a single page cache.

See https://github.com/bxcodec/httpcache/blob/e926f2b6999907b20502599204946ee15730d767/roundtriper.go#L222

martinei avatar Nov 24 '21 06:11 martinei

Getting the same error when fetching GET also from different URLs

pablodz avatar Feb 01 '22 15:02 pablodz