cancel
Showing results for 
Search instead for 
Did you mean: 

Critical Path not working?

SOLVED

Critical Path not working?

Hello Magento Developers,

 

We are on 2.4.6-p4 and are following the instructions for Critical Path here: https://developer.adobe.com/commerce/frontend-core/guide/css/critical-path/

 

We enabled critical path on our site and placed our critical.css file in the correct path where we can see it being loaded in the dom. However, the other stylesheets don't appear to be deferred as the documentation claims. We are following web dev best practices as instructed by this article: https://web.dev/articles/defer-non-critical-css 

and using browser dev tools to analyze coverage of render-blocking resources. After enabling critical path, the report still shows the same stylesheets and the same FCP score.

 

Essentially what we expect is that Magento will add the rel="preload" and as="style" tags per the web dev documentation but it doesn't seem to do that.

 

Is there a step that we are missing or are we supposed to handle the deferring of other stylesheets? The documentation seems to indicate that Magento would do this on its own. Any replies and feedback much appreciated!!

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Critical Path not working?

I think this is relevant and it still didn't make it into the core - https://github.com/magento/magento2/pull/37814

Founder at https://agency418.com

View solution in original post

Re: Critical Path not working?

Appreciate this link! I was also looking in git history because the correct method was already there and was seemingly "accidentally" removed with this last commit. For now we are applying a composer patch to fix line 104. 

 

Thank you!

View solution in original post

2 REPLIES 2

Re: Critical Path not working?

I think this is relevant and it still didn't make it into the core - https://github.com/magento/magento2/pull/37814

Founder at https://agency418.com

Re: Critical Path not working?

Appreciate this link! I was also looking in git history because the correct method was already there and was seemingly "accidentally" removed with this last commit. For now we are applying a composer patch to fix line 104. 

 

Thank you!