Caching HTTP responses not in Fastly's default list

Comments

2 comments

  • 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?

  • 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);
    } ```

Please sign in to leave a comment.