Fastly is not respecting Expires header?

Comments

1 comment

  • Cassandra Dixon

    Hi Tian,

    There are a few things I see based on this output.

    1) It appears your origin is sending a Cache-Control: max-age header.

    If this is true, the Cache-Control header will take precedence over the Expires header. We honor Surrogate-Control, Cache-Control, and Expires headers from the origin in that order.

    2) Stale-While-Revalidate means that Fastly will serve the stale version while fetching the refresh object from origin after the original TTL has expired. Based on your setup you have a TTL (Cache-Control: max-age: 3600) of an hour. The stale-while-revalidate is also set for an hour. Thus if a datacenter receives a request for an object that has expired, stale exists, and it is within an hour since the original TTL, Fastly will serve stale.

    Based on the Age header it is within this range (under 7200s: Original TTL + Stale-While-Revalidate TTL) and the request to the edge node was a MISS.

    I hope this helps explain the behavior being seen.

    Best, Cassandra

    0
    Comment actions Permalink

Please sign in to leave a comment.