• Resolved lutechi

    (@lutechi)


    Hello Frank,

    Hope you have been well. Recently I migrated a site to a VPS with easyengine and is pure NGINX with redis cache and php7.

    Everything has been working fine, until I decided to try “Inline and Defer CSS” since I had some extra time to work on to get the CSS. It seems like when I activate it, it will include the CSS I put for above the fold, but the JS line that it usually puts at the footer to call for the CSS is not there. So it tries to work but it seems like it forgets to put that script to load the CSS after the page has loaded.

    I tried to disable the CDN, reinstalled the plugin, cleared caches and no go. I have similar setup in a different hosting with Apache + varnish and php 5.4 (I know old, but that’s another story) with no problems on this setting for above the fold.

    I saw another topic with NGINX, but his problem is that nothing was working at all so I am not sure if is related or not because without “inline and defer” the CSS is combined without problems as external or inline.

    https://wordpress.org/plugins/autoptimize/

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

    (@futtta)

    No idea what’s happening there lutechi; the inlined code and the deferred code are both added in PHP, at approx. the same time. this should just work. but as it obviously does not, we could try adding some debug output code (to the PHP errorlog) to understand what is happening?

    frank

    Thread Starter lutechi

    (@lutechi)

    Sure, whatever you need, I would like to find out what is causing it also. I might also do a test site, but at work at this moment.

    Plugin Author Frank Goossens

    (@futtta)

    first step would be for me to see this happening, any chance of that? or do we wait for a test-site?

    Thread Starter lutechi

    (@lutechi)

    I will send you an email later with the test site, do not want to put the site URL and also do not want to break the live site while testing.

    Thanks Frank!

    Plugin Author Frank Goossens

    (@futtta)

    ok, you know where to find me 🙂

    Thread Starter lutechi

    (@lutechi)

    I sent the info to your email, thanks again!

    Thread Starter lutechi

    (@lutechi)

    To anybody that would like to know if there was a problem with NGINX, there wasn’t. Is working perfectly. It was something else, explained below.

    The problem was an HTML comment for a tracking script that was misleading the plugin in to think the comment was a real tag inside of it and therefore it was breaking it. Example of the HTML comment: “put it in between <body> and </body> tags”.

    I wonder if you can add a solution for that, to be like “check if tags are not inside a comment then do a function”. So it helps in the future to other people that might receive scripts like mine with stuff like that lol. If it was for me I would of removed the comment, but some agencies require it cause either it might trigger something or just don’t understand is not needed most of the time. In this case they wanted me to not remove the comment.

    Thanks Frank for the help!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘NGINX and "Inline and Defer CSS"’ is closed to new replies.