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

    (@futtta)

    by default, critical CSS is inserted inline, whereas the “normal” CSS is deferred until after document load. as soon as the domcontentloaded-event fires, there is JS that will insert the links to the autoptimized CSS in the head as well and those will be downloaded. at that point you will indeed have two sets of CSS; a part inline (used to style the page initially) and the normal external CSS (inserted by JS after the doc has loaded) which contains all styles.

    so if that is what you’re seeing; that’s not an issue, it’s by design. if you’re seeing something else, you’ll have to be a tad more specific (a URL helps, generally) ??

    frank

    I’m having the same exact problem, it’s inserting what I pasted in the “inline” text box twice.

    https://goo.gl/CT5y1v

    Plugin Author Frank Goossens

    (@futtta)

    mcmcghee0519; I see, that’s not supposed to happen, clearly.

    the root cause is two-fold; there’s known issue in AO where it will insert CSS (or JS) multiple times if the tag it inserts before or after is present multiple times. and that is happening here, as you have double title-tags (which is not supposed to happen either).

    solutions:
    * the next AO will have a fix for this, only inserting at the first instance of the replacement-tag
    * make sure there’s only one title-tag on your site (probably introduced in your theme’s header.php).

    hope this helps,
    frank

    Plugin Author Frank Goossens

    (@futtta)

    quick update; I just committed a fix for this problem on GitHub. Feel free to test by applying the code from the commmit (replace one line) or by downloading the current development version from GitHub.

    have fun,
    frank

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘'Inline and Defer CSS' inserting css twice!’ is closed to new replies.