Skip to content

Add options for setting Cache-Control #1

Open

Description

@faultyserver

See propershark/shark#29. There should be an option for specifying the Cache-Control headers on every request.

Since the DoubleMap API is real-time, I think it makes sense to disable caching by default, and allow users to opt-in for individual requests.

See this SO question about how to ensure Caching is always disabled.

Activity

  1. faultyserver commented on Sep 24, 2016

    @faultyserver
    MemberAuthor

    It'd be nice if I could remember how I implemented things from the beginning...

    By default, most API methods are memoized, meaning that requests with the same parameters will use a local cache, rather than resending requests to the source.

    While this is great from an efficiency standpoint, and is mostly desirable behavior, it requires users to either add an additional true parameter to reset the cache at call time, or call #flush_cache on the containing object before making a new request.

    The cause of propershark/shark#29 is that the user is not flushing the cache between update cycles, and so after the first request, every subsequent cycle will use the local cache (the parameters never change). The best fix for this would be to include an api.flush_cache call at the top of refresh in each source.

    I'm almost 100% sure that propershark/tripspark_api#1 is a result of this same problem.

    I'm not going to close this issue yet, since I do think there should be some top-level configuration option for enabling/disabling the cache system, but the immediate issue should be resolved.

  2. added a commit that references this issue on Sep 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions