Vary Header not applying correctly

Discussion in 'General' started by jeffand, Feb 9, 2009.

  1. jeffand

    jeffand New Member

    Our caching proxy servers require the vary: accept-encoding header for every response wether or not a compressed page is requested. Adding "Vary: Accept-Encoding" to the extra headers configuration section of litespeed adds the vary header twice to the response if the response is compressed. It should append the value of the header if the response already contains the vary header. Our caching proxy servers only pay attention to the first vary header they see in the response and ignore the second.

    Is there a way to turn on vary headers even if the content is not compressed so our caching proxy can properly cache the responses?

    Thanks,
    --Jeff
  2. mistwang

    mistwang LiteSpeed Staff

    Does it hurt if there are two "Vary: Accept-Encoding" headers.
  3. jeffand

    jeffand New Member

    Our reverse web proxy only pays attention to the first one it sees. So pages that are compressed may not get cached if it never sees accept-encoding: gzip.
  4. mistwang

    mistwang LiteSpeed Staff

    Still not sure what exactly is the problem, but I think it is a bug in the cache proxy not LSWS, it should be able to take two "Vary" headers.

    Maybe the easiest solution is to use LSWS 4.0rc1 cache function and get rid of the cache proxy.
  5. jeffand

    jeffand New Member

    Apache has mod_headers to prevent duplicate headers from responses and the http 1.1 spec seems to recommend against creating duplicate headers in a response.

Share This Page