Title: BUG: Disk:Enhanced
Last modified: January 28, 2019

---

# BUG: Disk:Enhanced

 *  Resolved [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * (@kocakserdar7)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/bug-diskenhanced/)
 * Hi,
 * Hope you’re fine! 🙂
 * Finally, I configured W3TC very well on Nginx web server. I’m using Disk:basic
   option and I have added custom http headers like “**X-robots-tag
    noindex, nofollow
   ”
   via Nginx configuration. Also Multilingual Press plugin added below http header:
   “
   link: [https://example.net/tr/](https://example.net/tr/) rel=”alternate”; hreflang
   =”tr-TR” [https://example.net/](https://example.net/) rel=”alternate”; hreflang
   =”en-US” for SEO purpose. Everything is working well.
 * However, If I set page cache method “Disk:enhanced”, all of above http headers
   are removing. Also W3TC is removing its own security headers on “browser cache
   settings” such as **X-Frame-Options** header or **Referrer Policy** header.
 * What is difference between Disk:basic and Disk:enhanced? Why these custom http
   headers are removed by plugin?
 * Thank you,
    Best regards.
    -  This topic was modified 7 years, 5 months ago by [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/).
      Reason: correction

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

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/bug-diskenhanced/#post-11140455)
 * Hello,
 * The headers are probably added using PHP instead of in NginX. Enhanced doesn’t
   touch PHP, so the header is not added, while Basic only speeds up the building
   of the page, so plugin functionality in PHP still works.
 * It’s weird that the X-Frame-Options don’t work when Enhanced. Probably because
   they’re added after the page cache rules, so the security rules are not reached.
 * It is expected to include security headers when enhanced, but since you just 
   switched the engine it means that you might have not configured the inclusion
   of generated rules.
 *  Thread Starter [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * (@kocakserdar7)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/bug-diskenhanced/#post-11145582)
 * Hi bro, 🙂
 * Yes, Enhanced doesn’t touch PHP, so the header is not added. But any Nginx header
   is not added too. **I found the cause of the bug.** It is related to **W3TC Nginx**
   configuration.
    -  First, please read below post:
       [https://www.peterbe.com/plog/be-very-careful-with-your-add_header-in-nginx](https://www.peterbe.com/plog/be-very-careful-with-your-add_header-in-nginx)
    - And below config code is created by W3TC Disk:Enhanced. Check please:
    -     ```
          location ~ /wp-content/cache/page_enhanced.*html$ {
              add_header X-Powered-By "W3 Total Cache/0.9.7.1";
          }
          ```
      
    - Because of the enhanced config, “**X-Powered-By: W3 Total Cache/0.9.7.1**”
      header is visible only. Other security headers are added to browser cache 
      part of the config by W3TC. Such as **X-Frame-Options, Referrer Policy** are
      removed from http headers by Nginx. Also **charset utf8 **is removed from **
      content-type** header too.
    - And this is another example which is created by W3TC (For js and css files):
    -     ```
          location ~ /wp-content/cache/minify/.*\.css$ {
              types {}
              default_type text/css;
              expires modified 31536000s;
              add_header X-Powered-By "W3 Total Cache/0.9.7.1";
              add_header Vary "Accept-Encoding";
              add_header Pragma "public";
              add_header Cache-Control "public";
          }
          ```
      
    - Again all of other http security headers are removed by Nginx. (Like **X-Frame**)
 * Main idea is that, **NGINX always fulfills requests using the most specific match**.
   I can’t fix it because I shouldn’t edit config lines created by W3TC. But You
   may fix it at next update. Please.
 * My English is not good sorry about that. However, I hope you understand it bro.
   Feel free to ask anything if you don’t understand my poor language. Or deploy
   a simple nginx server and then turn on security headers with Disk:enhanced. You
   will see everything. 🙂
 * Nginx is next generation of webmaster world. Even personal bloggers will migrate
   their websites to Nginx soon. And hope we’ll make W3TC better. 🙂
 * I marked it as resolved but let me know your feedback please. Thanks,
    Best regards.
 *  Thread Starter [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * (@kocakserdar7)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/bug-diskenhanced/#post-11188496)
 * Hi [@vmarko](https://wordpress.org/support/users/vmarko/) ,
 * Did you check it?
    Thanks! 🙂
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/bug-diskenhanced/#post-11192279)
 * Hello [@kocakserdar7](https://wordpress.org/support/users/kocakserdar7/),
 * sorry for the delay. After looking deeper into this, we can confirm this is a
   bug related to W3 Total Cache. This will be fixed in future update.
    Thank you
   for bringing this to our attention.
 *  Thread Starter [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * (@kocakserdar7)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/bug-diskenhanced/#post-11192636)
 * [@vmarko](https://wordpress.org/support/users/vmarko/) You’re most welcome 🙂
   
   King regards.

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

The topic ‘BUG: Disk:Enhanced’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/bug-diskenhanced/#post-11192636)
 * Status: resolved