Hello there, I’ve created a website with a custom block theme and even got the website to get all 100 points on the Lighthouse test, also because of the plugin. Thank you very much!
However, visitors complain about the website being broken. I only can replicate this issue when visiting the site with a VPN (interestingly not always, maybe a localisation issue?). The console logs the error Uncaught SyntaxError: Unexpected token '<'
Here is a screen recording that shows the issue better than I could explain:
The page I need help with: [log in to see the link]
That is odd. I saw the same thing but when I added a random number to the URL, like ?123 it generated a new cache file and that version was ok.
I think there’s a bug on your site causing this error, that only shows to some users. This plugin caches it as a static html page and then that html is served to everyone.
I saved the html of your front page twice, once when it was broken, once when it was fixed and saw a few odd differences. Even the body tag was different:
The later <a href="https://linktec.com/" chunk of code links to an actual image on the fixed site, but on the broken one, it uses an uuencoded image.
Maybe disable some of the optimization plugins you have installed and see if that makes a difference? I’m confident it’s not a problem in this plugin. It’s only highlighting the problem because the broken pages are cached.
Thanks for the quick response and testing! I now have all plugins deactivated and only WP Super cache activated. This issue still exists having WP super cache activated without any other plugins. It must at least somehow related to this plugin. Can you try again on your end?
Thanks for the video. That is enlightening. Can you send me a copy of your theme so I can try it on a test site? There’s a form on https://odd.blog/the-development-version-of-wp-super-cache/ you can use, if you can zip it up for me, put it on Dropbox, or your site and send me a link to it, I will test it.
Does the theme have any user agent sniffing so it displays things differently to some browsers? I noticed the page was corrupted when you ran the tester, so I tried to grab it (using GET parameters for fresh caches) with wget and curl but the cached versions were ok.
The plugin uses an output buffer to grab the contents of the page to store it. It doesn’t do any minification of the JavaScript or modify CSS or images at all, unless you have the CDN feature enabled. That CDN feature just rewrites hostnames. It doesn’t convert them to uuencoded data for example.
I managed to download a copy of your front page when it was broken. There’s something weird going on there. The broken page has translated elements like “Comments Feed” and is using style.min.css where the fixed page uses the German “Kommentar-Feed” and uses style.css
I noticed something that might be the reason for this. I loaded your page but some of the images were blank. I opened the image in a new browser tab and instead of the image I saw your homepage again. When I refreshed, the image appeared.
I did the same with viewing the source of style.min.css when the page looked broken and your front page source showed. When I refreshed, the minified css file showed.
Do you have a reverse proxy in front of your site? Or some sort of local proxy or mod_rewrite rules or something that’s supposed to cache static content?
Do you have a reverse proxy in front of your site? Or some sort of local proxy or mod_rewrite rules or something that’s supposed to cache static content?
I am not aware of this, but I’ll check in with my hoster.
I don’t know much about server configuration and caching, but I found that nginx cache was activated. Deactivating it did in fact resolve the issue, however I do not see any difference in loading times between nginx caching or using the plugin.
What would be the advantage of using the WP Super cache plugin over the nginx cache? Is there any difference? Using both simultaneously doesn’t seem to work.