You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Brendan, not really: the goal for this library is to cache everything, even requests that the server do not intend to be cached (cf. https://github.com/StalkR/httpcache/blob/master/cache.go#L59 that caches all 200 and 301). It's not meant as a caching mechanism like in browsers.
I created it primarily to test libraries fetching pages and parsing them so that tests would only fetch it once, then re-use the same page in following runs of the tests, this way testing only just the parsing code (e.g. https://github.com/StalkR/imdb/blob/master/init_test.go).
So I'd recommend creating another library for this, but feel free to fork and evolve this one if you think it's a good basis!
Cheers
Activity
StalkR commentedon Nov 19, 2015
Hi Brendan, not really: the goal for this library is to cache everything, even requests that the server do not intend to be cached (cf. https://github.com/StalkR/httpcache/blob/master/cache.go#L59 that caches all 200 and 301). It's not meant as a caching mechanism like in browsers.
I created it primarily to test libraries fetching pages and parsing them so that tests would only fetch it once, then re-use the same page in following runs of the tests, this way testing only just the parsing code (e.g. https://github.com/StalkR/imdb/blob/master/init_test.go).
So I'd recommend creating another library for this, but feel free to fork and evolve this one if you think it's a good basis!
Cheers