Getting started
Basics
Domains & Origins
Performance

Configuration
Basics
Conditions
Dictionaries
Domains & Origins
Request settings
Cache settings
Headers
Responses
Performance
Custom VCL
Image optimization
Video

Security
Access Control Lists
Monitoring and testing
Securing communications
Security measures
TLS
Web Application Firewall

Integrations
Logging endpoints
Non-Fastly services

Diagnostics
Streaming logs
Debugging techniques
Common errors

Account info
Account management
Billing
User access and control

Reference

    Setting Surrogate-Key headers for Amazon S3 origins

      Last updated August 16, 2018

    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 web interface and click the Configure link.
    2. From the service menu, select the appropriate service.
    3. Click the Configuration button and then select Clone active. The Domains page appears.
    4. Click the Content link. The Content page appears.
    5. Click the Create header button. The Create a header page appears.

      the Header window with surrogate key info filled in

    6. Fill out the Create a header fields as follows:
      • In the Name field, type a human-readable name for the header. This name is displayed in the Fastly web interface.
      • From the Type menu, select Cache, and 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.
    8. Click the Activate button to deploy your configuration changes.
    Back to Top