WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. giladpn
    Member
    Posted 3 years ago #

    Hi

    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
    http://www.porticor.com/wp-content/w3tc/min/b82dd9/default.include.1925601153.css

    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
    Member
    Plugin Author

    Posted 3 years ago #

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

  3. giladpn
    Member
    Posted 3 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?

    Thanks

    P.S. You can look at the UPDATED minified CSS file
    http://www.porticor.com/wp-content/w3tc/min/b82dd9/default.include.1925601153.css

  4. Frederick Townes
    Member
    Plugin Author

    Posted 3 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
    Member
    Posted 3 years ago #

    Frederick,

    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
    Member
    Posted 3 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.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic