Problem/Motivation

The Defer configuration option doesn't work. It doesn't save, and there is no logic in the module to use it.

This prevents the use of another defer option such as the AdvAgg module.

Proposed resolution

Fix it.

Patch is in progress.

Comments

kentr created an issue. See original summary.

kentr’s picture

Status: Active » Needs review
StatusFileSize
new2.98 KB
albertosilva’s picture

Thanks for your feedback, @kentr,

Anyway, I don't completely understand the problem with the defer option. You said that "the Defer configuration option doesn't work", but in fact that option is not available for this module.

I think that adding such an option doesn't make much sense, because the only thing that could be deferred is the Filament Group's polyfill that implements the preload strategy for non-compliant browsers. This polyfill should be as close as possible to the critical css block, in order to start loading the global css as fast as possible. Thus, deferring that block of JS or moving it to the bottom of the page is a bad idea.

Also, the patch you submitted is not working as expected, IMHO. It only displays the polyfill if the defer option is checked, which makes no sense.

Could you please give more details about the issue?

Regards,

Alberto Silva

albertosilva’s picture

Status: Needs review » Postponed (maintainer needs more info)
kentr’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Ahh...

Looking into it a bit more, I think I had started to add a "Defer" option on my dev copy, and then came back to it later thinking it was already part of the module.

Background:

I'm working with Critical CSS and the AdvAgg module together, and noticed that this module's rewrite of the CSS (and the polyfill) overrides the AdvAgg defer options.

Only the AdvAgg version of the CSS deferment was being recognized by PageSpeed Insights as actually being non-blocking, so I wanted to allow the AdvAgg defer settings to work while still using this module for the inline critical CSS.

Also, the patch you submitted is not working as expected, IMHO. It only displays the polyfill if the defer option is checked

That is the intention.

If "Defer" is disabled, then the module won't rewrite the CSS to defer loading of non-critical CSS. In this case, the Critical CSS module would only inline the critical CSS.

The assumption is:

  • There would be another mechanism (such as AdvAgg) for deferring the non-critical CSS.
  • The other mechanism would add the polyfill as required.

I'll close this.