When a page contains too much characters, the Cloudflare scripts are added after the closing html tag, and then the browser does not load them.
For analytics script this means missed analytics, for the rocket loader script this means a broken site.
As links are not allowed I cannot add an example, but the page source is:
May I ask have you tried disabling some features at Cloudflare dashboard like:
Auto Minify options
Therefore, using “Purge Everything” to flush the cache at Cloudflare and double-checking this using a different Web browser?
I wonder, if you temporary use “Pause Cloudflare for this site” option from the bottom-right corner at the CF dashboard → Overview tab, is your HTML code valid and are all the HTML tags properly closed?
Hi @fritex , thanks for your response. I am replying in behalf of Silvan, we are both checking this issue.
I purged cache, and the issue remains.
About the other test, I configured my hosts file to point directly to backend server and got a direct html response without Cloudflare man in the middle. The html I got is valid, no major issues, no unclosed tags.
Html for this page is quite big, we think this could be the reason why Cloudflare is failing to parse it correctly. Is there a limit on the size?
740174 characters in source html (not through Cloudflare)
Checked and although there are errors, none of them seem to be related. For example: Error: CSS: font-family: is an incorrect operator. Error: CSS: font-weight: 0 is not valid, only values greater than or equal to 1.0 are allowed.
but it can’t process all the file because it fails with a timeout (maybe the file size again is the reason). I am looking for an online html validator that allows me to share a link with the results.
Sure, but CF forumos does not allow me to add links.
www.swanmarket.nl is the domain, and
is an example of the wrong script tag (check at the bottom of the html, and you will see the
Howeer, on a product page, I can see the WP Super Cache plugin and my best guess is the options from it are either wrongly configured or something “on-the-fly” compresses it via “checked option” and caches the webpage as HTML, therefore serves it compressed as gzip in a bit weird way
Have you tried disabling the WP Super Cache plugin?
Nevertheless, you’re also using Cloudflare APO for WordPress.
I created a clone site so as to test it worry-free. I have disabled wp-cache plugin, purged cache, loaded page from incognito mode with browser cache disabled. Same behaviour.
Then I enabled rocket loader feature on CF, with a page rule, only for the cloned site. And now you can see at the bottom of the page that both cf analytics and rocket loader scripts are added after html tag is closed.
You can check it here.
I found the plugin that is triggering CF error. The “woo-variation-gallery” plugin, it adds some fancyness on how images are displayed. I re-enabled all plugins, also wp-cache and when I disable “woo-variation-gallery” plugin (only that one), CF adds the scripts correctly.
is still there and it does not seems to bother.
I still don’t understand why browser displays it correctly but CF is not able to parse it and add scripts after closing html tag. It is not a normal behaviour.
Nothing strange, only the wp-super-cache comments. Is the same behaviour whether we have super-cache or not. The issue only shows up with “woo-variation-gallery” plugin. Tried disable super-cache and enabling woo-variation-gallery, and CF fails to add the scripts.
No reply from CF support yet.