• Resolved stevemullen

    (@stevemullen)


    We installed blackfire.io (a profiler) and found and fixed a few issues. One remaining issue is with Autoptimize. The profiler says that preg_replace() is called 51,724 times at a cost of 506 ms. The caller is processAtRulesAndSelectors() [Autoptimize\tubalmartin\CssMin\Minifier]

    This is confusing to me, as (I think) it indicates that the minifier is executing over the page every time the page is loaded, even though “Save aggregated script/css as static files?” is checked, and the “Can we write?” value is ‘Yes’.

    autoptimize Version 2.5.1
    Wordpress Version 5.2.2

    I am happy to provide any information you request.

    Thank you
    Steve

    The page I need help with: [log in to see the link]

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

    (@optimizingmatters)

    Hmm, if the hash of un-minified aggregated CSS does not match (due to whatever difference in there), it will re-minify and cache the file under a different hash. so check if the amount of CSS-files in cache is somewhat stable and if not try to figure out what is busting the cache and causing the minifier to be ran?

    Thread Starter stevemullen

    (@stevemullen)

    Very helpful suggestion, and great support!

    We had 1 section of css with random ids ( slideshow_49583 ) that were generated on each page view. I’ve converted that to be a page specific id, but the problem remains. The minifier is still executing preg_replace() 50k+ times.

    For now, I’ve just disabled css minification, and that seems to have helped quite a bit.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    still weird ??

    * is the “minify excluded CSS/ JS” option on? if so, can you disable that?
    * when you remove all css-files form cache/autoptimize/css, request one page to build the optimized CSS and then request that exact same page again, do you still see the preg_replaces being executed?
    * page-specific CSS will obviously mean you have an optimized CSS-file per page, have you tried excluding the (inline?) CSS that holds the slideshow_pageid id?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Profiling site shows autoptimize bottleneck’ is closed to new replies.