Opted in to the new Speed page but now some of our source code & files are being overwritten

I’ve been going in circles with support so I figure now is a good time to share with everyone. Soon after the new speed page was announced then I opted in & enabled Enhanced HTTP/2 Prioritization. Seemed fine but no obvious difference. Our issues started when we revamped our site to have critical CSS loaded inline & the rest later where our code & files were noticeably changed.

Different types of our pages have different critical CSS inline and all of our product pages are having their critical CSS rewritten by Cloudflare’s servers and in some ways I see where could be potential improvement that way but there are too many issues with how its being done. So as is you’ll see that the core 6 pages in the top navigation menu & all of our product category pages are unaffected but again all of our product pages are being affected which is a big problem since that’s over 44K of them and the bulk of our site.

So let’s compare the HTML Source from origin vs. Cloudflare-modified:

As shown above, you can see that following the 1st style tag then it starts with @font-face CSS rule for the Open Sans Google Font with src URLs pointing to /cdn-cgi/styles/fonts/ which is not on our origin server & only generated by Cloudflare but completely different styles are there when unaltered by their servers as you’ll see later.

Here is another comparison showing some of our original critical CSS code but mixed in with many Cloudflare references like #cf-wrapper for example & even has some code for possibly showing an error but with their own image hosted at /cdn-cgi/images/ error_icons.png which again is not from our origin at all. I suppose this is being added to help optimize loading speed since Open Sans is the one being used in our main navigation menu & 1st heading (h1 tag) but its not retaining enough of the original code to be optimal enough & is causing more problems than its trying to help.

So as I pointed out before that Open Sans font was being loaded from their edge servers under /cdn-cgi/styles/fonts/ but as you see here (and as I found out later) the original font-face code is still retained with references to the original files (in //www.plcsource.com/wp-content/uploads/sgf-css/) & styles but its now farther down the page & so is being ignored by the browser and there are some considerable differences that weren’t retained when it was rewritten that are causing problems (e.g. the first example):

  1. The attribute, font-display:swap was completely removed causing considerable (1.1-2.1 seconds) performance related delays since without it then the browser is waiting for the font to load before rendering that part of the page
  2. the WOFF2 formatted files were excluded but should not be due to better compression
  3. the Cloudflare-hosted font files have an absurdly short Cache TTL of 2 hours when I’d rather it be a year at most or 12 hours at the lowest

Now hopefully this will help provide feedback to whichever team is responsible for this rewriting of code for optimization since according to Patrick Meegan on their blog about the HTTP/2 prioritization feature he said that “It doesn’t modify the page or execution at all and only impacts the connection for the domain it is turned on for” so I’m at a loss as to what feature/option with Cloudflare is causing this. Also until it can be fixed to work properly then I’ll need to be able to disable it.

I tried disabling Enhanced HTTP/2 Prioritization & Auto Minify earlier but didn’t seem to help revert this until going into Development mode and purging all caches. Will experiment with some other things while I’m awaiting a reasonable response.

Thanks,
Josh

1 Like

Hi @plcsource , thank you for the feedback and sorry about the issue you’re seeing. I’ve noted a link to this detail on your ticket and cc’d myself on it in order to track.

1 Like

interesting observations @plcsource

wonder if the rewritten ones are to simulate cloudflare features that are available and not enabled by cf end user for the speed page tests ?

Wow. Nevermind, quite an odd one but I figured it out. :neutral_face:

I now see that both my staging & production sites are no longer having this issue. Now a little bit ago, I did change something on our production site and had it regenerate the critical CSS for me but this time there wasn’t any Cloudflare revised code on our product pages. I’m fairly sure that it was due to using an external critical CSS generation service from LiteSpeed Cache which was extracting some code from either a challenge or blocked page and reproducing it repeatedly. I’ll investigate whitelisting them in the Cloudflare firewall later and then I’m sure this will clear up from popping up again.

1 Like