Skip to content

[Cache] cache control header handling #58

Closed

Description

@dbu

currently, the CachePlugin does not cache when the no-store or private directive is active. however, we ignore no-cache. should we respect that one as well?

btw, not caching on the private header might be wrong. "private" means a shared proxy may not cache this. it depends on the scenario whether our client is a shared "proxy" or only for a single end user. (api calls with an api username would be single user and caching "private" should be fine).

maybe we should add an option to specify which headers are considered uncacheble, defaulting to all 3 of private, no-cache and no-store. users could then overwrite the default list with their things, possibly even work around no-store from a faulty server.

another thing is cookie handling: on a proxy, you never cache if there are Authorization or Cookie headers around, for fear of mixing up content. for a client this is less clear, depends on the scenario. might require another option on the plugin? or as joel proposes below, two separate plugins for the two different roles.

Activity

  1. joelwurtz commented on Feb 17, 2016

    @joelwurtz
    Member

    Maybe having 2 plugins would be best for that : a CacheBrowserPlugin, CacheProxyPlugin, where the defaults are corectly set for each use case ?

  2. dbu commented on Feb 18, 2016

    @dbu
    ContributorAuthor

    they would simply differ by what default settings they propose? i think this would make sense for clarity, the roles are different and you need to understand rather a lot of caching if you need to set the right options manually.

  3. joelwurtz commented on Feb 18, 2016

    @joelwurtz
    Member

    I also think the code would be different, really not the same purpose and options for this two behavior, for me the actual implementation is closer to a Browser One.

    And like you said, would be best to have a functional view before a technical one for each of the plugin we propose, so user would know which plugin for its use case without learning all the different options.

  4. dbu commented on Feb 18, 2016

    @dbu
    ContributorAuthor

    I also think the code would be different, really not the same purpose
    and options for this two behavior, for me the actual implementation is
    closer to a Browser One.

    not sure how much differences there really are. maybe we can at least
    have an abstract base class for common functionality.

  5. joelwurtz commented on Feb 18, 2016

    @joelwurtz
    Member

    maybe we can at least
    have an abstract base class for common functionality.

    Sure, at least caching and restoring the response with stream is a bit special and can be abstracted, maybe we can provide a base cache class where we only have to write the cache decision logic and this may be used by the CacheStalePlugin (not sure if possible)

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions