Code Monkey home page Code Monkey logo

Comments (14)

superpoincare avatar superpoincare commented on May 23, 2024 1

Thanks. Can manage. Good coding exercise for me :-)

from autoptimize.

futtta avatar futtta commented on May 23, 2024

nothing changed really, but e.g. "important comments" are left as is by the PHP YUI CSS optimizer, so ...

from autoptimize.

superpoincare avatar superpoincare commented on May 23, 2024

Hi Frank,

My css doesn't have special comments but I still see line breaks.

There's a setting in minifiers and perhaps it's line breaks is default in some, so that old IEs which cannot parse very long lines can read them. I think the limit is large so removing line breaks makes more sense as default.

from autoptimize.

futtta avatar futtta commented on May 23, 2024

well, normally AO (well php yui css min) does not leave line breaks (just checked my site, only linebreaks are in the legacy MS-specific inlined background-image stuff). can you share your URL so I can have a look at the goings-on in your CSS?

from autoptimize.

superpoincare avatar superpoincare commented on May 23, 2024

Yeah, the site is www.concertedaction.com and the AO css file is: http://www.concertedaction.com/wp-content/cache/autoptimize/css/autoptimize_5a174eceff80afd5113b428efe60dfa4.css

I also use W3TC, and have switched off its HTML minification for test. When I enable it, it's the one minifying the inline css. (Also note: inline css provided in minifiers form by me).

from autoptimize.

futtta avatar futtta commented on May 23, 2024

Your AO CSS-file indeed does have the linebreaks which PHP YUI CSS would remove, so AO is using a non-default minifier. This can happen for 2 reasons:

  1. if you activated the legacy minifiers (see FAQ on how to do that)? OR
  2. AO detects that there already is a CSSmin class (loaded by another plugin, W3TC maybe) and hence does not load its own (php css yui)?

from autoptimize.

superpoincare avatar superpoincare commented on May 23, 2024

Oh possible. W3 Total Cache was recently updated after a long long time and probably explains why I am seeing this new behaviour: dont remember it happening before. Will experiment by disabling it etc.

(Not using legacy minifiers, so that option isn't the case)

from autoptimize.

superpoincare avatar superpoincare commented on May 23, 2024

That indeed seems to be the issue. Have disabled w3tc and the file has just one line!

You can check. Still disabled. (Clear the cache as the filename seems to be the same)

from autoptimize.

futtta avatar futtta commented on May 23, 2024

indeed. check if entirely disabling any/ all minify options in W3TC helps maybe?

from autoptimize.

superpoincare avatar superpoincare commented on May 23, 2024

Just disabling minify in W3TC while keeping the plugin active doesn't resolve. The file has line breaks. You can check. (Headers in files show "powered by w3tc" or something similar).

from autoptimize.

futtta avatar futtta commented on May 23, 2024

darn .. nothing AO can do here I'm afraid; W3TC should simply not instantiate a CSSmin if minification is disabled. you could add some code hooking into AO's API (using autoptimize_css_after_minify filter) to remove linebreaks (or switch page caching plugin)?

from autoptimize.

superpoincare avatar superpoincare commented on May 23, 2024

What code should I add? Any reference?

W3TC is a nice plugin despite its various shortcomings. I can anyway live with those linebreaks. I use a github fix of the plugin and the developers there are quite fast in fixing. This thread might get referred when I raise an issue there.

from autoptimize.

futtta avatar futtta commented on May 23, 2024

well, the code here removes important comments in the optimized JS. you would need something similar (probably simpler as you only need to remove the linebrakes) for CSS.

from autoptimize.

futtta avatar futtta commented on May 23, 2024

have fun! :)

going to close this ticket here, as not to AO as such.

from autoptimize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.