Giter VIP home page Giter VIP logo

Comments (2)

pickworth avatar pickworth commented on August 19, 2024 3

For completeness sake here is a basic checklist

Cache Bypasses
cache-control: no-cache (shouldn't be cached)
cache-control: no-store (used for sensitive info, shouldn't be cached)
cache-control: private (shouldn't be cached)
cache-control: must-revalidate (note this has special behaviour)
pragma: no-cache (prior to the implementation of cache-control: no-cache, this was generally used in the past)

Setting Timeouts
cache-control: max-age (timeout should be honoured)
cache-control: s-maxage (timeout should be honoured - shared cache)
expires: 0 (timeout should be honoured, note: 0 is basically another cache bypass)

Etag
etag - Because etag.

Vary
vary - Because vary.

from apicache.

kwhitley avatar kwhitley commented on August 19, 2024

@willfarrell This is specifically for request caching where the server maintains control (usually to protect against computationally expensive runs like database calls, processing, etc). If we honor every cache bypass (e.g. max-age=0, no-cache, etc) sent from the client, a hard refresh from any browser suddenly forces a cache-bypass across the board, hitting those expensive requests again even if the server deems that nothing has changed (or surely you would have cleared the cache after such changes).

We have "x-apicache-bypass" as an off-the-grid way to explicitly force from the client without being accidentally triggered from a standard practice.

I may put in a toggle to enable/disable basic client bypasses using these methods in an upcoming minor release if there is enough interest.

from apicache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.