Title: Prevent wordpress setting Cache-Control HTTP header
Last modified: August 30, 2016

---

# Prevent wordpress setting Cache-Control HTTP header

 *  Resolved [Marcus Pearson](https://wordpress.org/support/users/crackhd/)
 * (@crackhd)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/prevent-wordpress-setting-cache-control-http-header/)
 * In which file or where wordpress adds “cache-control” header?
    I disabled all
   my plugins to find out the reason of some headers, and discovered that WordPress
   always adds `cache-control: no-cache` header.
 * [This post](http://wordpress.stackexchange.com/questions/167128/prevent-wordpress-from-sending-cache-control-http-header)
   recommends filter for `wp_headers`, but i prefer to just remove it from wordpress
   code file to do not spend CPU for filters.
    Also, this solution not working for
   me on latest wordpress.
 * I need to configure my headers in my own way so how to prevent wordpress from
   adding it, in which file it is set?

Viewing 1 replies (of 1 total)

 *  Thread Starter [Marcus Pearson](https://wordpress.org/support/users/crackhd/)
 * (@crackhd)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/prevent-wordpress-setting-cache-control-http-header/#post-6386727)
 * In git repo i’ve searched for this http header.
    Filter name has changed. Correct
   code for this hack:
 *     ```
       add_filter('nocache_headers', 'wpfck_nocache', 99, 1);
       function wpfck_nocache($headers)
       {
           unset($headers['Cache-Control']);
           unset($headers['Expires']);
           unset($headers['Pragma']);//carefully
           return $headers;
       }
       ```
   
 * If you need to wipe it out just modify function at `wp-includes/functions.php:
   1024`

Viewing 1 replies (of 1 total)

The topic ‘Prevent wordpress setting Cache-Control HTTP header’ is closed to new
replies.

## Tags

 * [caching](https://wordpress.org/support/topic-tag/caching/)
 * [no-cache](https://wordpress.org/support/topic-tag/no-cache/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Marcus Pearson](https://wordpress.org/support/users/crackhd/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/prevent-wordpress-setting-cache-control-http-header/#post-6386727)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
