Title: Empty Vary HTTP header
Last modified: August 21, 2016

---

# Empty Vary HTTP header

 *  [Mike Doherty](https://wordpress.org/support/users/_doherty/)
 * (@_doherty)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/empty-vary-http-header/)
 * An empty Vary header may be added in PgCache.php at line 1243. I’ve done the 
   following to remove it:
 *     ```
       diff --git a/wp-content/plugins/w3-total-cache/lib/W3/PgCache.php b/wp-content/plugins/w3-total-cache/lib/W3/PgCache.php
       index 26f471c..432b6ac 100644
       --- a/wp-content/plugins/w3-total-cache/lib/W3/PgCache.php
       +++ b/wp-content/plugins/w3-total-cache/lib/W3/PgCache.php
       @@ -1239,8 +1239,10 @@ class W3_PgCache {
                /**
                 * Add vary header
                 */
       -        $headers = array_merge($headers, array(
       -            'Vary' => $vary));
       +        if ( $vary ) {
       +            $headers = array_merge($headers, array(
       +                'Vary' => $vary));
       +        }
   
                /**
                 * Add custom headers
       ```
   
 * [https://wordpress.org/plugins/w3-total-cache/](https://wordpress.org/plugins/w3-total-cache/)

The topic ‘Empty Vary HTTP header’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Mike Doherty](https://wordpress.org/support/users/_doherty/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/empty-vary-http-header/)
 * Status: not resolved