Skip to content

[Feature] - ETag if-modified cache invalidation #4

Open

Description

@brendanjerwin

Would it make sense handle Etags for cache invalidation in the same way a browser might?

Activity

  1. StalkR commented on Nov 19, 2015

    @StalkR
    Owner

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions