Title: Problem with compression
Last modified: August 20, 2021

---

# Problem with compression

 *  Resolved [divano](https://wordpress.org/support/users/divano/)
 * (@divano)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-compression-3/)
 * Hi,
    I love this plugin (your others too) but, after various test, observed that
   activating “zlib.output_compression” something goes wrong with Autoptimize: the
   admin bar stops working; it’s no longer possible to update theme; header height
   automatically increases creating an empty space and other malfunctions occur.
 * So I’d like to know if you have already encountered similar situations and, eventually,
   possible solutions.
 * Thanks so much in advance.
 * Regards.

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-compression-3/#post-14787697)
 * No, that’s a first divano ..
 * Some questions:
    * Are the problems you describe for the admin-pages or for anonymous
   visitors on the front-end? * Do you see errors in the PHP errorlog? * Do you 
   see errors on the browser console? * Are you sure you’re not causing output to
   be compressed twice (which typically results in browsers being unable to “understand”
   the response)? * Do you have “serve as static files” off in Autoptimize and if
   so do things work if you re-enable that option?
 * frank
 *  Thread Starter [divano](https://wordpress.org/support/users/divano/)
 * (@divano)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-compression-3/#post-14789136)
 *     ```
       Hi Frank, thanks for answer.
   
       Following order of your questions:
   
       * Is visible on front-end.
       * Error log says: PHP Notice:  ob_end_flush(): Failed to send buffer of zlib output compression (0) in /home/***/public_html/wp-includes/functions.php on line 4979 
   
       So, on function wp_ob_end_flush_all() {
       	$levels = ob_get_level();
       	for ( $i = 0; $i < $levels; $i++ ) {
       		ob_end_flush(); } }
   
       * No error detected by console.
       * I don't know honestly, but if you tell me how/where check, I'll take a look.
       * Enabled or not, effect is the same.
       ```
   
 * Thanks so much again.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-compression-3/#post-14789484)
 * > Error log says: PHP Notice: ob_end_flush(): Failed to send buffer of zlib output
   > compression (0) in /home/***/public_html/wp-includes/functions.php on line 
   > 4979
 * an output buffer error from WordPress core? lots of info to be found on the interwebz,
   most interesting one being [this wordpress core ticket](https://core.trac.wordpress.org/ticket/22430),
   in which a.o. this statement is made;
 * > Currently WordPress per default is not compatible with zlib enabled.
 * and this workaround code snippet is proposed for those who _want_ to use zlib
   compression at PHP level;
 *     ```
       remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
       ```
   
 * > I don’t know honestly, but if you tell me how/where check, I’ll take a look.
 * I would check the network tab in the browser developer tools, checking each request
   for non HTTP-200 (OK) replies and looking at the response body to see if any 
   of those has garbled text.
 * but why are you trying to `zlib.output_compression`? what is it you want to accomplish?
 *  Thread Starter [divano](https://wordpress.org/support/users/divano/)
 * (@divano)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-compression-3/#post-14790379)
 * Hi,
    We haven’t “non http-200” requests, while on thread you’ve linked (started
   nine years ago) it is also claimed that “turning off compression is NOT an acceptable
   option, despite all the people who suggest it”, in fact according to all speed
   and structure tester (thinkwithgoogle, pingdom, gtmetrix, site24x7, uptrends…),
   performance significantly improves with compression, reason why it was activated.
 * As always, thanks for the support.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-compression-3/#post-14790388)
 * > while on thread you’ve linked (started nine years ago) it is also claimed that“
   > turning off compression is NOT an acceptable option, despite all the people
   > who suggest it”
 * In that case try the code snippet provided by Nacin? 🙂
 * > in fact according to all speed and structure tester (thinkwithgoogle, pingdom,
   > gtmetrix, site24x7, uptrends…), performance significantly improves with compression,
   > reason why it was activated.
 * yes, compresssion is a must, but typically compression is (should be?) handled
   at webserver-level for static resources and is generally handled by the page 
   caching layer for the HTML output.
    -  This reply was modified 4 years, 9 months ago by [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/).

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

The topic ‘Problem with compression’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/problem-with-compression-3/#post-14790388)
 * Status: resolved