Setting Surrogate-Key headers for Amazon S3 origins

You can mark content with a surrogate key and use it to purge groups of specific URLs at once without purging everything, or purging each URL singularly. On the Amazon S3 side, you can use the x-amz-meta-surrogate-key header to mark your content as you see fit, and then on the Fastly side set up a Header configuration to translate the S3 information into the header we look for.

Follow these instructions to set Surrogate-Key headers for Amazon S3 origin servers:

  1. Log in to the Fastly application.
  2. Click the configure tab (wrench icon).

    the configure tab

  3. From the Service menu, select the appropriate service and then click the blue Configure button. The main controls for the selected service appear.

  4. Click Content from the section list on the left.

    the Content window

  5. In the Headers area at the top of the page, click the New button. The New Header window appears.

    the New Header window with surrogate key info filled in

  6. Fill out the New Header fields as follows:

    • In the Name field, type a human-readable name for the header.
    • From the Type menu, select Cache. From the Action menu, select Set.
    • In the Destination field, type http.Surrogate-Key.
    • In the Source field, type beresp.http.x-amz-meta-surrogate-key.
    • From the Ignore If Set menu, select No.
    • In the Priority field, type 10.
  7. Click the Create button to create your header.

To publish the new header, deploy the version of the service you are editing.

Back to Top