How to capture a header && append a value to it


#1

How to capture a response header and append an additional value:

In app.fastly, you will set this up under Configure–>Content–>Header

  1. Create a new header
  2. Set
    Type’ : Cache
    Action’: Set
  3. Destination: http.X-Name-of-header (ie, http.Vary)
  4. Source: if(beresp.http.Vary, beresp.http.Vary ", ", "") "New Value"

In the above example, if the Vary header was sent from origin, we would append "," to it before appending the New Value . Otherwise, the header would simply have been set to New Value.