Caching HTTP responses not in Fastly's default list



  • Blake Crosby

    Just a quick question. Can I use this same method to adjust the TTL for the HTTP responses in Fastly's default list? Ie, if I want to set a TTL on 301s to something other than the default.

    Speaking of which, what is the TTL for the list of responses in the default list?

    Comment actions Permalink
  • Cassandra Dixon

    Hi Blake,

    Here are some options...

    via the Fastly app: Set the TTL (under Configure/Settings/Cache Settings) and then add a condition to the Cache Setting. For example: beresp.status == 301.

    via Custom VCL:

    ``` if ( beresp.status ==301 ) {

    # 301 Redirect set beresp.ttl = 900s; return(deliver);
    } ```

    Comment actions Permalink

Please sign in to leave a comment.