jsref icon indicating copy to clipboard operation
jsref copied to clipboard

http provider doesn't cache results

Open postatum opened this issue 7 years ago • 1 comments

Hi. First of all, thanks for a great project!

I've noticed a potential issue: Here it says Note that once a document is read, it WILL be cached for the duration of this object, unless you call Reset but it doesn't actually call hp.mp.Set() similar to how fs provider does.

I didn't test whether it actually makes requests on 2+ calls but the code looks like it will.

postatum avatar Jun 05 '17 12:06 postatum

Yeah, it's missing a call to Set. And now that I look at it, I'm not sure if I like the API either.

I'll think about it, but if you are up to it, maybe you could write up a failing test case using net/http/httptest as the provider source? :D

lestrrat avatar Jun 05 '17 12:06 lestrrat