grunt-critical icon indicating copy to clipboard operation
grunt-critical copied to clipboard

inline essentially causes the code to load twice?

Open whats1thingnow opened this issue 8 years ago • 1 comments

As per readme:

If dest points to an Markup file (HTML, PHP, etc.) the resulting CSS gets inlined and the exiting stylesheets are wrapped in a JavaScript function to load them asynchronously as well as a noscript block for users with JavaScript disabled

So that means, the critical pieces will be loaded the 1st time inside of the HTML.

Then, 2nd, the same critical pieces will be loaded again asynchronously (along with the non critical)?

Thank you for clarifying!

whats1thingnow avatar Apr 15 '16 17:04 whats1thingnow

@whats1thingnow that's true. Critical also supports an extractoption which removes the critical css from the source stylesheets. Keep in mind that this option might create different source stylesheets for different pages which will drop any caching benefits. See https://github.com/addyosmani/critical/issues/39 for further insights

bezoerb avatar Jun 11 '16 20:06 bezoerb