• From the last 2 weeks, i have noticed that “autoptimize_css_individual_style” hook is taking most time consumption as per newrelic.

    So, i want to know what’s the reason of taking time too long on this hook on every page reload?

    Can you please check either there is any bug in this hook or is there any settings issue or is there any filter which i can use to optimize this?

    Please let me know if i can make some changes to optimize the site performance.

    Thanks,
    Yasir

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Frank Goossens

    (@futtta)

    autoptimize_css_individual_style is hooked into by “autoptimize speedupper” which was introduced in AO 2.2 and which minifies and caches individual CSS (and JS). this (a.o.) avoids a huge amount of CSS- or JS-code having to be minified because of a small change in one block of code.

    This hook would typically take time if the CSS minifier component is called. This happens if;

    * the filename of the to-be-minfied CSS does not contain “min.css” (indicating a pre-minified file) and the CSS isn’t minified in cache yet
    * there is no filename (as it concerned inline CSS, which is minified but not cached).

    Based on this I think the problem is that AO is re-minifying a serious chunk of inline CSS, which -if the time consumption is noticeably long- you could exclude from CSS optimization by adding it to the comma-separated list of AO CSS optimization exclusions. Alternatively you could untick the “also aggregate inline CSS”-option.

    hope this helps,
    frank

    Thread Starter Yasir

    (@yasglobal)

    We have an big site and we have attached above-the-fold CSS as the inline Style. Secondly, Autoptimize Cache get full in approx. 2 hours and i need to manually clear it. Third, there is some data on which i have an doubt.

    Like: Utilization: 26%, Size: 130 MB and Files:147

    Does it helps you to provide some further assistance to me. sometime i browse few pages and cache is full

    Plugin Author Frank Goossens

    (@futtta)

    -> for the “above-the-fold CSS”; if you did not add it via AO’s “inline & defer” option, you’ll have to exclude that from being aggregated
    -> for the cache; this might very well be linked to your original post actually. see FAQ for info on why this might happen. to fix; check how many files are written to wp-content/cache/autoptimize/css vs wp-content/cache/autoptimize/js and based on that un-check “also aggregate inline JS” and/ or “also aggregate inline CSS”. if you’re on Divi or Avada (themes) you might also have to add wp-content/cache and/ or wp-content/uploads to the AO CSS optimization exclusions.
    -> for “data on which you have a doubt”; not really sure what those are from, can’t comment on that I’m afraid.

    frank

    Thread Starter Yasir

    (@yasglobal)

    Hi Frank,

    Thanks for your quick responses. I have tried v2.2.2 of the plugin and everything looks fine on this VERSION But when i apply the v2.3.1 or v2.3.2 then it starts degrading the performance of my website.

    I have checked the changelog of the plugin and found that you had applied workaround for Redis, Memcached in v2.3.2:

    workaround for stale options-data in external object cache such as Redis, Memcached (core bug) resulting in Autoptimize continuously………

    Maybe, this is causing the issue as my website is using Memcached but not sure…

    Hope, you can figure out something. I’ll update you if i found anyother info related to the plugin. For now, it looks a like this bug starts from v2.3.0 and still exist…

    Thanks,
    Yasir

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    no, the redis/ memcached bug is unrelated (it was specific to the cache preloading in the AO upgrade procedure).

    given your statement the problem started from the last 2 weeks and that 2.3.x has been out for 2,5 months already, this is probably due to a change on your system around that time probably due to inline CSS being introduced which is being re-minified time and time again.

    so; are you indeed aggregating inline CSS? and is there a lot of inlinen CSS? and you have you tried deactivating that option in AO? ??

    Thread Starter Yasir

    (@yasglobal)

    @optimizingmatters I was using the version 2.2.2 till the last week of Feb and updated to the latest version on that week. After that i am facing this issue.

    I was not aware of it and check some other points when i checked the transaction traces of newrelic then i come to know about your plugin.

    autoptimizeStyles::minify segment is the most time consuming on my website. It’s taking approximately 50% – 65% time of the page load.

    We are not aggregating inline css but yes we have inlinecss.
    Screen Shot 2018-03-19 at 19.39.16.png

    Thanks,
    Yasir

    • This reply was modified 6 years, 8 months ago by Yasir.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Well, now it’s becoming interesting. Could you share your site’s URL @yasglobal here or via mail (futtta-at-gmail-dot-com)?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘autoptimize_css_individual_style consuming most time on page load’ is closed to new replies.