How to create surrogate tag by API


1 comment

  • Peter Wohlers


    Surrogate keys are created by adding a Surrogate-Key: header rather than via an API. It's something that needs to be done prior to the caching of the object, so it can't be done retro-actively. Typically we see customers send them from their origin, or in their custom VCL via beresp.http.Surrogate-Key such as:

    if (beresp.status == 404) { set beresp.http.Surrogate-Key = "404"; } You can see if an object has a surrogate key by sending a Fastly-Debug:1 header with your request.

    Comment actions Permalink

Please sign in to leave a comment.