W3 Total Cache
Minify-CSS does not compress redundant white space? (6 posts)

  1. giladpn
    Posted 5 years ago #


    First of all, I would like to thank Frederick for fixing the previous minify bug I hit (the one where requiring https with minify had issues). The upgrade was smooth too. As a result I've rated the plugin highly. Thanks again!

    Another issue now arises: you can see it on http://www.porticor.com/

    Look at the minified CSS file

    Its well minified but redundant white space is not compressed.

    As a result the "google page-speed" score is low (red).

    Any way to solve this?

    Thanks in advance.

  2. Frederick Townes
    Plugin Author

    Posted 5 years ago #

    You haven't enabled line break removal, seems combine only is selected.

  3. giladpn
    Posted 5 years ago #

    Thanks, I made those changes.

    "Google page-speed" score is still low (red) - it seems that the issue is spaces and tabs that are not compressed rather than just line breaks.

    Basically, any string mixing spaces and tabs can be compressed to a single space. Tabs should not be treated separately from spaces - something like <SP><TB><SP> should become <SP>

    Is there a way to cause compression of redundant spaces and tabs?


    P.S. You can look at the UPDATED minified CSS file

  4. Frederick Townes
    Plugin Author

    Posted 5 years ago #

    I get the point, the problem is I've never seen this fail, even after reviewing hundreds and hundreds of sites. What is special about your files? How are your line feeds set?

  5. giladpn
    Posted 5 years ago #


    I am sending you an email with

    1. the original CSS
    2. CSS after w3tc minify
    3. CSS after pagespeed minify (they have a capability to do this in Google)

    As you can see, (1) is pretty regular except it uses tabs a lot. You can check for yourself - and also see how \r and \n are used

    (2) does not compress combinations of \n and \t (and perhaps \r) into a single space <SP> but rather into several characters

    As a result (3) is smaller and Google Page Speed gives a low score

    Hope this helps

  6. giladpn
    Posted 5 years ago #

    More input:

    I think you are treating tabs \t as "different" from spaces <SP> and line feeds/carriage returns.

    The upshot is that combinations of line feeds and tabs (text\n\tmoretext) are not handled perfectly. The line feeds and carriage returns are turned into spaces, and the result is "text<SP>\tmoretext"

    It may also be an ordering problem, perhaps compression happens before line feeds are turned to spaces?

    In any case, I sent you the original and compressed files, so you should be able to run the W3TC algorithm on them. As I see it, the goal is to achieve the same compression as pagespeed minify (3) - so you can benchmark against that if you like.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic