If a WordPress page becomes garbled, downloads as a file, or shows compressed characters after enabling gzip, first stop PHP zlib from compressing the response twice. Check the effective PHP settings, W3 Total Cache, the web server, CDN, and other optimization plugins; assign compression to one layer; purge every affected cache; then test that Content-Encoding matches the bytes actually sent. In most installations, letting the web server or W3 Total Cache own HTTP compression and setting PHP zlib.output_compression=Off is the stable arrangement.
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
What the conflict is
zlib.output_compression is a PHP output-compression mechanism. It is not a W3 Total Cache setting. When enabled, PHP can compress output when the browser advertises gzip or deflate, then add a Content-Encoding header and Vary: Accept-Encoding. W3 Total Cache can also compress or serve already-compressed page-cache output. Apache, Nginx, a hosting-panel rule, a CDN, or another optimization plugin may add another compression pass.
As an Amazon Associate I earn from qualifying purchases.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →The browser must receive headers that describe the final bytes. If a body is compressed twice, or a later layer changes or removes the header, the browser may display binary-looking text, offer the HTML as a download, or fail to render it. The same symptom can occur when a cached file contains bytes produced under an old compression configuration.
Recognize the symptoms before changing settings
- Garbled characters or a blank page: the response is probably encoded differently from the declared
Content-Encoding, or a compressed body was sent to a client that requested identity encoding. - HTML downloads instead of rendering: inspect
Content-TypeandContent-Encodingtogether. A mismatch between the body and encoding headers is a common cause. - Only cached pages fail: stale W3 Total Cache, reverse-proxy, or CDN objects may contain old bytes or headers.
- Only logged-in users or REST requests fail: those requests may bypass page cache and take a different PHP, server, or plugin path.
- The problem appears only after enabling gzip: compression ownership changed, but another layer was already compressing the same response.
How a WordPress response is compressed
A typical request can pass through several independent layers. Each layer must either leave the body alone or become the single owner of compression for that response.
#1 Best Overall
| Layer | What it can do | What to inspect |
|---|---|---|
| PHP | Compresses generated output through zlib before it leaves PHP. | zlib.output_compression, zlib.output_handler, and output_handler in the effective PHP configuration. |
| W3 Total Cache | Stores static page-cache files and exposes browser-cache and compression options. | Performance settings, generated Apache or Nginx rules, and whether cached files are already encoded. |
| Web server | Apache mod_deflate or Nginx gzip directives can compress responses at delivery time. |
Virtual-host or server-block configuration, included snippets, and hosting-panel overrides. |
| CDN or reverse proxy | May recompress or transform objects at the edge. | Edge compression, cache rules, and whether the CDN honors origin Content-Encoding. |
| Other plugins | Optimization, minification, or caching plugins can alter output and headers. | Recently enabled performance features and plugin-specific compression switches. |
Compression negotiation is based on the request’s Accept-Encoding header. A client that asks for gzip should receive a gzip body only when the response says Content-Encoding: gzip. A client that asks for identity should receive uncompressed bytes. Vary: Accept-Encoding tells caches that those representations are different.
Repair the conflict step by step
1. Capture the failing response
Do not start by toggling random options. Record a failing URL, whether you were logged in, and whether the response came from a cache. Browser developer tools can show response headers and the response preview. From a shell, capture headers first:
curl -I https://example.com/page/
Then request the body while preserving headers:
curl --compressed -D headers.txt https://example.com/page/ -o page.html
Also test an identity request, which asks intermediaries not to send a compressed representation:
curl -H 'Accept-Encoding: identity' -D identity-headers.txt https://example.com/page/ -o identity-page.html
Compare the status, Content-Type, Content-Encoding, and Vary values. A readable identity response but a broken gzip response narrows the fault to compression negotiation or a layer that handles encoded output incorrectly. If both are broken, inspect application output, caching, and content type as well.
2. Check the effective PHP configuration
Inspect the PHP configuration used by the web request, not only the command-line PHP installation or a global file. Hosting can assign different settings to PHP-FPM, Apache, and the CLI.
zlib.output_compressioncontrols transparent PHP compression. Record whether it isOn,Off, or a value inherited from a pool or hosting panel.zlib.output_handleridentifies a zlib output handler. An active zlib handler affects which other output handlers can be used.output_handlercan install another output-processing handler and must be checked for a competing compression or transformation step.
Use a temporary, access-restricted PHP information page or your host’s PHP settings panel to view the web runtime. Remove any diagnostic page immediately after checking it. If you edit php.ini, a per-directory configuration, or a PHP-FPM pool setting, reload or restart the relevant PHP service as required by your host. Confirm the new value through the web runtime; changing a file that the active pool does not read will have no effect.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
3. Inspect W3 Total Cache
In the WordPress dashboard, open the W3 Total Cache performance settings and review the sections for page caching and browser caching. Look for options that compress cached pages, HTML, CSS, or JavaScript. Note which options were enabled when the failure began.
Then inspect the rules W3 Total Cache generated for your stack. On Apache, review the relevant .htaccess sections. On Nginx, review the server configuration or include file used by the site. The generated rules may control cache routing, headers, or compression even when the visible dashboard option appears disabled. Save a copy before editing so you can restore a known-good state.
4. Inspect the web server, CDN, and other optimization layers
Search the active Apache configuration for mod_deflate rules and the active Nginx configuration for gzip directives. Also check snippets supplied by a hosting control panel. A server rule can compress output after PHP or W3 Total Cache has already done so.
If a CDN or reverse proxy sits in front of the site, inspect its edge-compression and cache settings. Determine whether it recompresses origin responses, preserves Content-Encoding, and stores separate objects for different Accept-Encoding values. Finally, temporarily disable compression or output-transformation features in other optimization plugins one at a time. Change one layer, purge the relevant cache, and retest so the result is attributable.
Rank #3
5. Choose one compression owner
Use one active mechanism for each response path. The following arrangements are practical starting points; the correct choice depends on which configuration you control.
| Owner | Best fit | Dynamic responses | Control and trade-off |
|---|---|---|---|
| PHP zlib | Small installations where PHP is the only practical configuration point. | Can affect generated responses, including paths that bypass page cache. | Easy to enable in PHP, but harder to audit when a server or CDN also compresses. |
| W3 Total Cache | Sites already relying on its page and browser-cache rules. | Cached pages are its strongest use case; dynamic and excluded requests may follow another path. | Settings are visible in WordPress, while generated server rules still require inspection. |
| Web server | Administrators who control Apache or Nginx and want one delivery-layer policy. | Can cover both cached files and dynamic responses that reach the server. | Reliable and central, but the relevant virtual-host or server-block file may be inaccessible on managed hosting. |
| CDN | Sites that intentionally centralize delivery optimization at the edge. | Usually applies to cacheable edge responses; origin and bypass traffic still need a valid policy. | Convenient for global delivery, but edge behavior can be opaque and must be tested separately. |
A common stable setup is to let the web server or W3 Total Cache handle HTTP compression and set PHP zlib.output_compression=Off. If your server must own compression, disable the equivalent W3 Total Cache compression option. Do not leave PHP, W3 Total Cache, the web server, and the CDN all claiming the same response.
6. Disable competing PHP compression safely
- Record the current PHP values and make a backup of the configuration you will edit.
- Set
zlib.output_compressiontoOffin the configuration actually used by the web request. - Remove or disable a competing
zlib.output_handlerunless your chosen design explicitly requires it. - Review
output_handlerfor another compression or transformation handler. Do not replace it with a second handler merely to suppress an error. - Reload the PHP runtime or follow the hosting panel’s restart procedure.
- Verify the values through the web runtime, then request a fresh response with the diagnostic commands.
Some hosts prevent customers from changing these directives. In that case, ask support to confirm the effective values for the site’s PHP-FPM or Apache pool and to disable transparent PHP compression, or ask which layer they require to own it.
7. Configure the selected owner and remove duplicates
If W3 Total Cache is the owner, enable only the relevant browser-cache or page-cache compression features, keep the generated rules consistent with the web server, and avoid a second plugin that rewrites the same headers. If Apache or Nginx is the owner, leave W3 Total Cache’s duplicate compression disabled while retaining only the cache features you need. If a CDN is the owner, verify that the origin sends a representation the CDN expects and that the edge does not apply a second pass to an already encoded object.
Do not copy a compression rule from one server type to another. Apache directives in .htaccess do not belong in an Nginx server block, and an Nginx include may be ignored by a different virtual host. Ask the hosting provider where the active rule is loaded when you cannot identify it.
Rank #4
8. Purge every stale representation
After changing ownership, empty the W3 Total Cache page cache, browser cache, and minify cache when those features are active. Purge the CDN or reverse-proxy cache as well. Clear any host-level full-page cache. A browser cache can preserve an old representation, so test in a private window or with a cache-busting query only after the server-side purges are complete.
Make the first verification request uncached if your platform provides that control. Then allow a new cache object to be created and test the cached URL again. This distinguishes a current configuration error from a stale object that still contains old bytes or headers.
9. Verify compressed and uncompressed paths
For a gzip response, the body must actually be gzip-encoded and the response must include Content-Encoding: gzip. Negotiation should normally include Vary: Accept-Encoding. Do not judge success from the header alone; use a client that decompresses the body and confirm the rendered HTML is readable.
Free tools Windows power users keep installed
One-click scans. No signup required.
Run a small test matrix:
| Request | What it checks |
|---|---|
Anonymous page with Accept-Encoding: gzip |
Normal compressed delivery and cache creation. |
Anonymous page with Accept-Encoding: identity |
Uncompressed representation and negotiation correctness. |
| Logged-in page | Dynamic or cache-bypassed PHP output. |
| POST request | Application paths that should not be treated like a static page object. |
| REST or other dynamic endpoint | Different headers, plugins, or server locations. |
Repeat the checks from a browser and from the command line. Confirm that the response remains readable after a cache hit, not just on the first uncached request.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Fixes for common failure branches
The page is still garbled after PHP zlib is disabled
Inspect the final response again. If Content-Encoding: gzip is present, identify whether W3 Total Cache, Apache, Nginx, or the CDN produced it. Check for two compression rules in generated and hand-written configuration. Purge all caches once more, because a stale object can survive a correct configuration. If the identity request is also unreadable, investigate content generation or a wrong Content-Type rather than compression alone.
Best Value
- Offer contains ONLY 2 titles regardless of the order quantity placed for this listing. Set of volumes may vary. Ordering in multiples will not change the volume received. Image is meant to display the type of book you will be receiving only.
- BRAIN TEASING. Perfect Puzzle Book for all ages to learn. Enjoy puzzles, maze, word search, or crosswords! This puzzle book is ideal for people on the go and will provide hours of entertainment.
- FUN & CHALLENGING. Exercise your brains long-term memory, working memory, executive functioning, attention to detail, multitasking, and processing speed. Perfect gifting item for those who love word search puzzles!
- RELAX, RECHARGE, & REFOCUS. The word find puzzle book offers an enjoyable challenge for all, from beginners to experts. Ideal for learning, practicing, and having fun time for various users.
- OFFICIALLY LICENSED. High-resolution printing. Perfect for family activities, classroom learning, or travel. Provide an engaging, educational experience with every page, making it both fun and meaningful.
The browser downloads an HTML file
Compare the download response’s Content-Type, Content-Disposition, and Content-Encoding with a known-good page. A body encoded as gzip while the header says identity, or a header added after the body was encoded, can make the browser treat the response as unusable data. Correct the layer that changes the header, purge its cache, and retest with both encoding requests.
Only pages served from cache fail
Disable page-cache delivery briefly and request the same URL. If the uncached response works, inspect the cached file’s encoding and the rules that serve it. Empty W3 Total Cache and edge caches, regenerate one object, and compare the new cache hit with the uncached response.
Only logged-in or API requests fail
These paths may bypass W3 Total Cache but still pass through PHP zlib, a web-server rule, or a plugin. Compare their headers with an anonymous GET. Keep compression behavior consistent, but do not force a dynamic POST or REST response through a static page-cache rule. Check exclusions and endpoint-specific server configuration.
Compression disappeared after the repair
A missing Content-Encoding is not automatically an error. An identity response is valid when the client did not advertise compression, when the content is excluded, or when the selected owner is disabled. If compression is required, verify the client’s Accept-Encoding, the selected owner’s rule, and whether a CDN or proxy is stripping the header. Confirm that the body and header agree before enabling another layer.
Managed hosting and limited access
When you cannot edit PHP, Apache, Nginx, or CDN settings, provide support with the failing URL, timestamp, whether you were logged in, the request’s Accept-Encoding, and the complete response headers. Ask them to confirm the effective values of zlib.output_compression, zlib.output_handler, and output_handler, identify the layer that owns compression, and purge host-level caches after the change. This is usually faster than repeatedly changing WordPress settings that the server overrides.
Quick Recap
Final verification checklist
- One clearly identified layer owns compression for each response path.
- PHP zlib is off when the web server or W3 Total Cache owns compression.
- No competing output handler remains active.
- W3 Total Cache generated rules match the actual Apache or Nginx stack.
- CDN and reverse-proxy behavior has been checked, not assumed.
- W3 Total Cache, host, reverse-proxy, CDN, and relevant browser caches were purged.
- Gzip and identity requests return readable bodies.
Content-Encodingmatches the bytes, andVary: Accept-Encodingis present where representations vary.- Anonymous, logged-in, POST, and REST requests have been tested separately.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →




