I have done some more WordPress tweaking on Fogelberg.com. The loading time for the images had become somewhat unbearable, which shouldn’t really happen since I was using plugins to handle that: The W3 Total Cache to cache everything, Shortpixel Image Optimizer for optimizing images and putting them on their CDN, and finally, the Autoptimize plugin for, among other things lazyloading images and fetching them from the Shortpixel CDN.
Especially the Photos page took forever to load. It seemed that none of the images was really cached. Using a cache plugin should speed up showing a page, images included. Now, all of the images seemed to be fetched from the CDN every time I reloaded a page. The result was a much slower website. Just loading the start page could take 14-15 seconds. That shouldn’t happen with a cache plugin installed.
I tried a lot of things to fix it. I cleared all the caches. Checked that all settings in the plugins seemed right. I changed a few plugin settings. I disabled the Image Optimizer plugin. No difference. I tried to use Shortpixel Adaptive Images, Shortpixel’s own plugin for fetching images from their CDN. No difference. As a last resort, I uninstalled all three plugins. Everything looked and worked exactly as before, i.e., badly.
Then, I had a look at the HTML code, specifically for how the images were shown, using a browser with a completely wiped history (nothing cached). The HTML code showed my pages were still cached and fetched images from the Shortpixel CDN, even though I had uninstalled all three plugins for that. They shouldn’t fetch images from the CDN, they should fetch them from my WordPress installation. WTH? I had a look inside the Cache folder in my WordPress installation. Surprisingly, it was full of stuff, cached pages that shouldn’t be there. This should all be deleted automatically when uninstalling the plugins.
I removed all the files in the Cache folder. Reloaded the website in a browser, and wow, low and behold, it was now showing the correct, uncached version. No more CDN URLs. Seems it was some sort of cache problem all along.
I don’t know if it was caused by Autoptimize or Total Cache, but I did some research and decided not to reinstall them. Instead, I now use WP Rocket. Yes, it’s not a free plugin, but finally, everything works as it should, and my site is quicker to load than before.
I’m happy again.