Title: Suspected cache problems (detailed)
Last modified: November 23, 2024

---

# Suspected cache problems (detailed)

 *  Resolved [leadhos](https://wordpress.org/support/users/leadhos/)
 * (@leadhos)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/weird-cache-problems/)
 * Hello,
   Just experienced some weird cache problems. Related to WP Super Cache,
   but not necessarily a bug. Just want to confirm the actual cause, so it does 
   not happen again.**Summary**
 * _Site is proxied through CloudFlare._ _PHP 7.4.33. Apache virtual host, Ubuntu
   Server 22.04. _
 * _Compress pages so they’re served more quickly to visitors. __(Recommended)_:
   Enabled
 * When navigating to pages on my domain, it triggered a .gz download in Firefox.
   Probably would have in Chrome too – but use Chrome daily, so browser cache probably
   masked the problem.
 * Rollback to default theme did not solve the problem, nor disabling Autoptimize(
   which should not serve gzip anyways). Clearing WP Super Cache did solve the problem,
   for now.
 * **Detailed**
 * Allright, as stated in the summary. Suddenly one of our sites started serving.
   gz files instead of the actual webpage. Analyzed file online (not locally in 
   case of injected files). Contents (one file) inside .gz, with no file extension,
   does indeed contain the cached page.
 * As per documentation:
    - **Cache files: **Both wp-cache-config.php and advanced-cache.php are present
      in ../wp-content/
    - **wp-config.php: **_define( ‘WP\_CACHE’, true );_ present in wp-config.php,
      before _require\_once(ABSPATH.’wp-settings.php’);_
    - **php.ini: **zlib.output_compression = Off
    - **mod_mime, mod_headers and mod_expires**: All enabled
 * Extra cache control, htaccess:
 *     ```wp-block-code
       <FilesMatch "\.(js|css|jpg|gif|png|pdf|swf|svg|svgz|ico|ttf|ttc|otf|eot|woff|woff2|webp)$"> <IfModule mod_headers.c>    ExpiresActive On    ExpiresDefault  "access plus 6 month"    Header set Cache-Control "public, immutable, max-age=15780000, s-maxage=15780000"    Header set Access-Control-Allow-Origin "*" </IfModule></FilesMatch>
       ```
   
 * Figured it was a cache problem, obviously. Inspected response headers. Browser
   does as instructed by content-type when error occurred (download gzip), but obviously
   not wanted. Relevant:
    - **Content-type when error occurred**: application_/x-gzip_
    - **Content-type after clearing cache, back to normal:** text/html; charset=
      UTF-8
 * **Suspected problem**
    - **Content-encoding:** zstd – must be CloudFlare.
       * Have other websites running WP Super Cache (same server and setup), where
         encoding is **gzip **as expected. Those are not proxied through CloudFlare.
    - **mod_deflate: **Enabled – but zlib compression disabled. Either way, never
      had a problem with that for 5 years.
 * So… Any ideas? I suspect conflicting caching between WP Super Cache / CloudFlare,
   or conflict with mod_deflate.
 * Solution may be as simple as disabling “_Compress pages so they’re served more
   quickly to visitors_“?
 * Regardless of solution, also want input on why content-type was served as application/
   x-gzip. Can’t see how CloudFlare would affect exactly that.
 * Would very much like to get to the bottom of this, so it does not happen again.
   With local browser caching, it’s hard to know when these kind of errors occur.

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

 *  [girlswithguns](https://wordpress.org/support/users/girlswithguns/)
 * (@girlswithguns)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/weird-cache-problems/#post-18165567)
 * I believe I have also been experiencing a similar problem, with pages being “
   downloaded” rather than displaying. For now I’ve disabled caching, but would 
   like to know if this is a plugin issue.
 *  Plugin Support [Alin (a11n)](https://wordpress.org/support/users/alinclamba/)
 * (@alinclamba)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/weird-cache-problems/#post-18182771)
 * Hi [@leadhos](https://wordpress.org/support/users/leadhos/),
 * Thank you for the detailed explanation! Based on what you’ve shared, it does 
   sound like there may be a conflict between WP Super Cache and Cloudflare’s handling
   of cached and compressed files.
 * The best course of action to prevent this from happening again would be to disable
   the **“Compress pages so they’re served more quickly to visitors”** setting in
   WP Super Cache. Since your site is proxied through Cloudflare, the additional
   compression from this setting is likely redundant and could be causing the issue
   you’ve described.
 * Cloudflare already handles compression very efficiently, so disabling this setting
   in WP Super Cache should resolve the content-type issue you experienced and minimize
   the risk of similar problems in the future.
 * If the issue persists or you notice any unexpected behavior, feel free to share
   more details, and we’ll be happy to help further!
 * [@girlswithguns](https://wordpress.org/support/users/girlswithguns/) per the 
   forum guidelines, even if the issue appears to be similar, please open a new 
   support thread so we can handle them individually. Thank you!
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/weird-cache-problems/#post-18189078)
 * > Regardless of solution, also want input on why content-type was served as application/
   > x-gzip. Can’t see how CloudFlare would affect exactly that.
 * This plugin sets the content-encoding to `gzip` [here](https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/super-cache/wp-cache-phase2.php#L19),
   so maybe something else on your server is setting the content-type. However, 
   about 15 years ago something similar was reported and I added extra checks on
   the homepage. There’s a check for x-gzip [here](https://github.com/Automattic/jetpack/blob/trunk/projects/plugins/super-cache/wp-cache.php#L3000)
   because of it. I could never figure out what caused the problem.
    -  This reply was modified 1 year, 5 months ago by [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/).
 *  Plugin Support [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * (@erania-pinnera)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/weird-cache-problems/#post-18207838)
 * Hi there, [@leadhos](https://wordpress.org/support/users/leadhos/),
 * It’s been more than one week since the last interaction in this thread, so I’m
   going to mark it as solved for now. If you have any further questions or need
   more help, you’re welcome to open another thread here. Cheers!

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

The topic ‘Suspected cache problems (detailed)’ is closed to new replies.

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

## Tags

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

 * 4 replies
 * 5 participants
 * Last reply from: [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/weird-cache-problems/#post-18207838)
 * Status: resolved