If mod_filter is used to configure mod_deflate like this: BrowserMatch ^Mozilla/4 no-gzip BrowserMatch "\bMSIE [7-9]" !no-gzip Header append Vary User-Agent env=!dont-vary FilterDeclare compress-response FilterProvider compress-response DEFLATE Content-Type $text/ FilterProvider compress-response DEFLATE Content-Type $application/x-javascript FilterProtocol compress-response change=yes;byteranges=no it is not possible to add the Vary: User-Agent header only if the filter is actually activated. Maybe mod_filter should have some additional support for adding a Vary header or setting an env var. There was a small thread about this at http://mail-archives.apache.org/mod_mbox/httpd-dev/201105.mbox/%3C04c5ce0bd8c5475999a305514e8d697a.squirrel@www.sfritsch.de%3E