Title: apache htaccess advanced cache setup
Last modified: December 30, 2019

---

# apache htaccess advanced cache setup

 *  Resolved [werdpres](https://wordpress.org/support/users/werdpres/)
 * (@werdpres)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/apache-htaccess-advanced-cache-setup/)
 * 1. how does one verify that the htaccess directives are working?
 * i’m looking at the net requests and i’m not recognizing a difference with or 
   without the code in htaccess, but i’m not sure what i should be looking for
 * the number of file requests and time to load is essentially the same
 * 2. WP is installed in the web root and i’m not using webp, so does any of the
   code need to be commented out?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fapache-htaccess-advanced-cache-setup%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Anonymous User 16850768
 * (@anonymized-16850768)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/apache-htaccess-advanced-cache-setup/#post-12306507)
 * You can [verify if the advanced snippet is bypassing PHP](https://www.keycdn.com/support/wordpress-cache-enabler-plugin#how-can-i-verify-that-the-advanced-snippet-is-bypassing-php)
   by checking your page response headers. If the `X-Cache-Handler: wp` response
   header is present then it’s been properly implemented.
 * If you’re not using the Cache Enabler plugin to deliver WebP formatted images
   you can optionally comment out (or remove) the `# webp HTML file` section.
 *  Thread Starter [werdpres](https://wordpress.org/support/users/werdpres/)
 * (@werdpres)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/apache-htaccess-advanced-cache-setup/#post-12308246)
 * ah, ok, i saw it in the docs now … might want to move the “How can I verify …”
   part to the “Advanced Configuration” section perhaps 🙂
 * also i think you got it backwards at keycdn…
 * “If the X-Cache-Handler header is **not** present, then your advanced configuration
   snippet is properly implemented.”
 *  Anonymous User 16850768
 * (@anonymized-16850768)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/apache-htaccess-advanced-cache-setup/#post-12309364)
 * Thank you for sharing your feedback. Please accept my sincerest apologies as 
   I made a mistake in my first reply. If the advanced snippet is used and the `
   X-Cache-Handler: wp` (or `X-Cache-Handler: php`) response header is **not** present
   then it’s been implemented correctly.
 * When checking your website I see the Cache Enabler HTML comment in your page 
   source and the `X-Cache-Handler` response header is not present:
 * `<!-- Cache Enabler by KeyCDN @ 09.01.2020 07:06:38 (html) -->`
 *     ```
       HTTP/2.0 200 OK
       date: Thu, 09 Jan 2020 17:35:47 GMT
       server: Apache/2
       x-content-type-options: nosniff
       last-modified: Thu, 09 Jan 2020 12:06:38 GMT
       etag: "383d4-59bb3d75f13a1-gzip"
       accept-ranges: bytes
       vary: Accept-Encoding,User-Agent
       content-encoding: gzip
       x-xss-protection: 1; mode=block
       x-permitted-cross-domain-policies: none
       x-dns-prefetch-control: off
       referrer-policy: no-referrer-when-downgrade
       content-length: 38234
       content-type: text/html
       X-Firefox-Spdy: h2
       ```
   
 * This indicates that you’ve implemented the advanced configuration correctly.
 *  Thread Starter [werdpres](https://wordpress.org/support/users/werdpres/)
 * (@werdpres)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/apache-htaccess-advanced-cache-setup/#post-12310272)
 * thanks Cory
 * i’m also curious about the results of gtmetrix which grades poorly regarding 
   caching…
 * PS: Leverage browser caching (75)
    YS: Add Expires headers (56)
 * the missing expire headers bothers me most – i have ‘Cache Expiry’ set to 1 hr.
 *  Anonymous User 16850768
 * (@anonymized-16850768)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/apache-htaccess-advanced-cache-setup/#post-12313378)
 * Those recommendations are unrelated to the Cache Enabler plugin. Cache Enabler
   is a lightweight page caching plugin. This means a static HTML page is generated,
   saved to the server disk, and then delivered to your visitors instead of having
   to generate that page on each request. Currently this plugin doesn’t add or modify
   the `Cache-Control` and `Expires` response headers.
 * To improve those performance scores I’d recommend checking out this [Fix Leverage Browser Caching Warning](https://www.keycdn.com/blog/leverage-browser-caching)
   article.
 *  Thread Starter [werdpres](https://wordpress.org/support/users/werdpres/)
 * (@werdpres)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/apache-htaccess-advanced-cache-setup/#post-12313770)
 * thanks for the info Cory … i use what i think is an excellent WP plugin, ‘HTTP
   Headers’, which made it super easy to add the (not so) necessary headers

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

The topic ‘apache htaccess advanced cache setup’ is closed to new replies.

 * ![](https://ps.w.org/cache-enabler/assets/icon.svg?rev=2442383)
 * [Cache Enabler](https://wordpress.org/plugins/cache-enabler/)
 * [Support Threads](https://wordpress.org/support/plugin/cache-enabler/)
 * [Active Topics](https://wordpress.org/support/plugin/cache-enabler/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cache-enabler/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cache-enabler/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [werdpres](https://wordpress.org/support/users/werdpres/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/apache-htaccess-advanced-cache-setup/#post-12313770)
 * Status: resolved