The MU forums have moved to WordPress.org

Is compression completely broken? (15 posts)

  1. suleiman
    Member
    Posted 14 years ago #

    Hello all,

    I've been trying to enable server-level gzip compression on my wpmu powered site, but all to no avail.

    I've checked my httpd.conf file and can insure the mod_deflate module is getting loaded (I'm on apache2). But everytime I try and actually trigger it I get internal server errors.

    I've tried including it in my .htaccess file in my httpdocs folder like so:


    # compress all text & html:
    AddOutputFilterByType DEFLATE text/html text/plain text/xml

    # Or, compress certain file types by extension:
    <Files *.html>
    SetOutputFilter DEFLATE
    </Files>

    And I've also tried appending the following to the bottom of my httpd.conf file:

    DeflateFilterNote Ratio ratio
    DeflateCompressionLevel 9
    FilterDeclare COMPRESS
    FilterProvider COMPRESS DEFLATE resp=Content-Encoding !$gzip
    FilterProvider COMPRESS DEFLATE resp=Content-Type $text
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-javascript
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/.*xml.*
    FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
    FilterChain COMPRESS

    But neither seems to work, and both throw out the same server 500 error. Any ideas guys?

  2. suleiman
    Member
    Posted 14 years ago #

    I'm surprised nobody's tried this yet. On my bbpress install there's been a significant speed boost from throwing in gzip compression. If we could make it server-side of course, I'd be much happier.

  3. cafespain
    Member
    Posted 14 years ago #

    Hi
    I'm running a test server with Litespeed which has gzip compression enabled with no problems, and was testing the Nginx web server, also with gzip compression enabled, last week with no problems either.
    I've not tried Apache so can't comment on it's setup - but WPMU is probably not the problem.
    Rgds
    Barry

  4. honewatson
    Member
    Posted 14 years ago #

    Gzip works awesome with Nginx. I think Nginx is one of the first things you should look at if you're looking to improve speed and scalability - or if you just want to get more out of a single server.

  5. cafespain
    Member
    Posted 14 years ago #

    I did like Nginx, and the speed with gzip was amazing. But for now I'm going to stick with Litespeed, the web admin is a lot easier and the speed is still there. I'll look at Nginx again if/when the site takes off and I need more bang for my buck. Unless I'm rolling in it, then I'll think about the paid version of Litespeed :)

  6. lunabyte
    Member
    Posted 14 years ago #

    I've played with and used Litespeed as well. I'm really enjoying it, and their support is pretty good as well.

  7. suleiman
    Member
    Posted 14 years ago #

    The problem is definitely not with Apache -- compression in bbpress works a treat -- but every time I enable gzip compression via wp-supercache, my visitors are prompted to download a gzip file everytime they view the site. And every time I try to go the server route and set compression settings via the .htaccess file I get an internal server error.

    Just doesn't add up!

  8. intoxination
    Member
    Posted 14 years ago #

    Sounds like a problem with MIME Types on Apache. I know there has been talk before of certain OS builds not playing nice with it.

    What you might want to try is remove the rewrite in .htaccess for the gzip files, then go with just deflate in httpd (loading the module and adding SetOutputFilter DEFLATE should be enough). See if it works then. If that's the case then I would say it's a MIME issue with Apache not delivering the gzip file correctly. You might also want to check the super-cache forums, since I know this problem has come up before:

    http://wordpress.org/tags/wp-super-cache

  9. honewatson
    Member
    Posted 14 years ago #

    Yeah it sounds like MIME Types. You need to change your httpd.conf or apache2.conf.

    Check this news:

    http://mu.wordpress.org/forums/topic.php?id=7999&page&replies=1

  10. suleiman
    Member
    Posted 14 years ago #

    Just got this bad boy working and WOW what a difference!

    I'm surprised so many wpmu-powered sites aren't using this already, it is definitely the most significant speed boost I've seen since using wp-super-cache.

    Are there any known conflicts/issues with gzip encoding on wpmu that I'm clueless to?

  11. cafespain
    Member
    Posted 14 years ago #

    I've had no issues so far, though compression is only on my new server at the moment and it only has development blogs on it at the moment.

    I did read somewhere (I'll have to start bookmarking these sites) that the difference in size between a compression level of 6 and 9 is negligible but the processing difference to compress to level 9 is a lot greater. So a setting of 6 may increase the performance of your server.

    If I find the link, I'll post it below

  12. cafespain
    Member
    Posted 14 years ago #

    Also, if you can - set the compression to only occur on files/pages greater than 5k as the benefits compared to the processing required for files smaller than 5k are negligible. It is easy to do this with Litespeed (it's actually the default), but not sure how with Apache.

    See note 3 on http://www.websiteoptimization.com/speed/tweak/compress/

  13. suleiman
    Member
    Posted 14 years ago #

    cafespain, why did you drop nginx for litespeed?

  14. cafespain
    Member
    Posted 14 years ago #

    Ease and speed of admin really. Litespeed has a nice (and advanced) web-based administration panel, Nginx is all text config files.

    But I do like Nginx, from the testing I did it was blindingly fast at serving WordPress MU.

    I'm going to run Litespeed for a bit and see how it does (mainly because I'm 2 weeks away from my go-live date and I don't have the time to build the server again :) ), but I'm going to install Nginx on my backup server and if it plays nicely I may well switch back.

    That will also be the case if the site(s) get popular, as I think I'd rather take the admin hit of Nginx than the financial hit of Litespeed enterprise.

  15. honewatson
    Member
    Posted 14 years ago #

    I've turned off Supercache gzip and left the gzipping to Nginx.

About this Topic

  • Started 14 years ago by suleiman
  • Latest reply from honewatson