Verifying origin cache related headers

Comments

2 comments

  • Amir Yalon

    In custom VCL, you can add:

    In sub vcl_fetch, close to the top:

    set beresp.http.X-Origin-Cache-Control = beresp.http.Cache-Control;
    

    And in sub vcl_deliver:

    if (!req.http.Fastly-Debug) {
        unset resp.http.X-Origin-Cache-Control;
    }
    

    This will make sure to always attach the X-Origin-Cache-Control value to the cached object, but will only expose it to the client if Fastly-Debug is on.

    0
    Comment actions Permalink
  • vijaycs85

    Fastly respects standard response headers from origin. So unless you add a custom rule to remove it, always get the Cache-Control header (of origin) in your client even without Fast-Debug.

    0
    Comment actions Permalink

Please sign in to leave a comment.