Title: HTTP_CACHE_CONTROL does not get set
Last modified: August 21, 2016

---

# HTTP_CACHE_CONTROL does not get set

 *  Resolved [herbert](https://wordpress.org/support/users/herbie4/)
 * (@herbie4)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/http_cache_control-does-not-get-set/)
 * I used the plugin to set Cache-Control: max-age=0 on product pages of woocommerce.
   That works perfect!
 * The only problem is that the $_SERVER[‘HTTP_CACHE_CONTROL’] does not get set.
 * 1. If I press reload of browser button it does get set.
    But just using the plugin
   with the max-age=0 it does not.
 * 2. Tested the server with just a php file with the following:
 *     ```
       header("Cache-Control: max-age=0"); //HTTP 1.1
       ```
   
 * That also results in $_SERVER[‘HTTP_CACHE_CONTROL’] => max-age=0
 * Any suggestions what to do?
 * [https://wordpress.org/plugins/add-headers/](https://wordpress.org/plugins/add-headers/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [herbert](https://wordpress.org/support/users/herbie4/)
 * (@herbie4)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/http_cache_control-does-not-get-set/#post-5066053)
 * Okay, took a different approach to the problem so this question is no longer 
   valid.
 *  Plugin Author [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * (@gnotaras)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/http_cache_control-does-not-get-set/#post-5066217)
 * Hi Herbert,
 * Despite resolving the issue yourself, I’m providing the following sample code
   to demonstrate the “official” method of doing this, in case others would like
   to do something similar.
 *     ```
       function addh_no_cache_products ( $options ) {
           if ( is_product() ) {
               $options['cache_max_age_seconds'] = 0;
           }
           return $options;
       }
       add_filter( 'addh_options', 'addh_no_cache_products', 10, 1 );
       ```
   
 * George

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘HTTP_CACHE_CONTROL does not get set’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/add-headers.svg)
 * [Add Headers](https://wordpress.org/plugins/add-headers/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/add-headers/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/add-headers/)
 * [Active Topics](https://wordpress.org/support/plugin/add-headers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/add-headers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/add-headers/reviews/)

## Tags

 * [response headers](https://wordpress.org/support/topic-tag/response-headers/)

 * 2 replies
 * 2 participants
 * Last reply from: [George Notaras](https://wordpress.org/support/users/gnotaras/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/http_cache_control-does-not-get-set/#post-5066217)
 * Status: resolved