My wordpress site is hosted on SiteGround and I signed up for the free Cloudfare option. Siteground automatically created a 301 redirect to the www subdomain which is connected to Cloudfare in the DNS – I know that part at least went properly.
But so far, I cannot tell that anything has changed.
When I view the source of my web pages, I was expecting to see the src attribute for images and scripts now pointing to cloudfare. But as far as I can tell, they are still loading from my SiteGround server. Is that not how it works?
If I open developer tools in Chrome and look at the sources, there IS now a rocketloader script being pulled in from cloudfare, but otherwise, nothing seems different. Cloudfare seems to have just ADDED an extra script to load, which I would expect slows down my site more than it improves it.
I just had a look at pagespeed insights, and the results are pretty bad. Worse than before I implemented cloudfare. (Previously I was using Autoptimize and Cache Enabler plugins for wordpress, but I switched them off because I assumed cloudfare would render them redundant.)
Finally, I’ve turned on auto minify for html, js, and css. I see that my site’s CSS files ARE being minified. But the HTML is not.
So, I am generally confused. If I look at my cloudfare analytics dashboard, I see that cached files are being served, but lots of non-cached files are also being served. Why?
It sounds like Cloudflare is fully enabled on your site.
Cloudflare will make non-cached html pages slower to load. But all of the resources therein much faster. I suggest turning Autoptimize and Cache Enabler back on. Then clear the cache in Cloudflare. I would also turn Rocket Loader off.
When I view the source of my web pages, I was expecting to see the src attribute for images and scripts now pointing to Cloudflare. But as far as I can tell, they are still loading from my SiteGround server. Is that not how it works?
This is not the correct way to check if Cloudflare is caching your content. Head over to https://gtmetrix.com/, enter your site URL and navigate to the “Waterfall” tab. Click on any resource you wish to check and you should see something like this.
Look at the “cf-cache-status” header to see the status. HIT means Cloudflare is caching etc. You can visit here for more information.
If I open developer tools in Chrome and look at the sources, there IS now a rocketloader script being pulled in from Cloudflare, but otherwise, nothing seems different. Cloudflare seems to have just ADDED an extra script to load, which I would expect slows down my site more than it improves it.
I just had a look at pagespeed insights, and the results are pretty bad. Worse than before I implemented Cloudflare. (Previously I was using Autoptimize and Cache Enabler plugins for wordpress, but I switched them off because I assumed Cloudflare would render them redundant.)
What rocketloader does is by bundling your script file and loading them asynchronously. Therefore adding a script does not mean it would slow down your site.
Cloudflare did mentioned that rocketloader isn’t for everyone and you should only use it if it is beneficial to you. Personally, I have no luck with rocketloader and the biggest take away from CF is their caching capabilities.
So, I am generally confused. If I look at my Cloudflare analytics dashboard, I see that cached files are being served, but lots of non-cached files are also being served. Why?
One reason would be that your site is not getting much traffic. Cloudflare caches your content only after the first person have requested for that resource. You should generally see an improvement in caching after awhile.
That cache setting you changed to 1 Year is the browser cache setting. You can experiment with Page Rules to set some resources to “Set Edge Cache TTL”. It’s the Edge Cache TTL that affects CF-Cache-Status. That status tells you if the resource is cached on a Cloudflare server. Try a page rule that matches example.com with just the Edge Cache TTL of 1 Month. That should help keep your JPGs in cache longer.
In the example you show, it’s a JPG, so that it gets cached by default at the Edge.
It takes a while to fully populate the Edge servers. Each Edge location has several servers, so it make a few hits before all servers in that region gets a HIT.