• Resolved tahtu

    (@tahtu)


    I have a main.min.css inside my theme, which contains a definition for the “woocommerce” class. But inside the whole used HTML code, this class will never be used.

    If I’m right, it will not be used, since I disabled a lot of features of this theme.

    By optimizing the CSS code, it would be possible AO analyze the CSS and the HTML code and deliver only that parts of the CSS code, which are used inside the HTML code. This would reduce the network traffic and the speed indeed.

    Does this not work, since the theme uses a filename with min inside of it, or does AO not support this way of optimization?

    Autoptimize: Version 2.5.1
    WordPress: Version 4.9.10
    Theme: Hueman, Version: 3.4.21

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    No, autoptimize does not remove unused CSS @tahtu, it only combines & minifies & defers (if configured to). As ideally the same Autopimized file is used on multiple (all?) pages, it would be practically impossible for AO to analyze.

    hope this clarifies,
    frank

    Thread Starter tahtu

    (@tahtu)

    Thank you for your response.

    In my case, I include the CSS into the HTML completely.

    While doing this, AO could analyze the HTML code with regular expressions to detect the used classes. I think, this would not be a lot of work for you, isn’t it?

    After this, you could do the same with the CSS code. And than you could apply only the used CSS definitions.

    Ok, ok, this is not be implemented within a single day, indeed. But it would be possible, I think.

    Maybe you take my ideas as a feature request for the future.

    But I agree with you: This would take a lot of time while executing the matches. So maybe it would be senseful only, if an page cache like WP Total Cache is active.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    who knows one day, but it would likely rather be based on the critical CSS power-up, offloading the actual CSS extraction to criticalcss.com ??

    frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How does AO work?’ is closed to new replies.