Different pagespeed problems using main and addon domain

Dear community,

I need your help in page load speed improvements.

Problems:

  1. The main page in EN with .com is loading on different page speed after trying several times.

The variation is several from 1,64 - 7.8 seconds. I am not sure why, because I’m just refreshing the page and check the loading speed again and getting different results.

  1. The 2nd addon page in DE with .de is loading in much higher amount of seconds.

EN page loading speed 1,64 but DE page loading speed 5,66 sec.

Our Settings:
Our website has 2 languages EN and DE. To enable the multilingual approach we setup this via wordpress by using WPML for different language approaches. The different languages are reached by adding the language in different URL structure “/” or “/de/”

CACHE Settings

  1. The Site Cache software in use on that site via plugins (autoptimize, wp supercache).

  2. At our server your Cloudflare Railgun and CPNGINX is installed and active

  3. On Cloudflare members page the settings are enabled to minify and cache all as well rocket loader is activated.

Usually, as the different languages are used at one site I made the setup & cache with just one domain approach. For testing purpose, I also added the addon domain.de to be used as additional domain in Cloudflare setup. BUT this has no positive infect either.

Please help to find out why the different languages differ in that high amount of page loading.

Best regards, Alex

Page loding speed test results:
pingdom tools speed test in EN - https://tools.pingdom.com/#5b7ba8c54e000000
pingdom tools speed test in DE - https://tools.pingdom.com/#5b7ba915c2800000

The main speed issue here comes from your origin. The HTML is not cached, so Cloudflare needs to fetch it at the origin every time these pages are requested. That means somehow WordPress is taking way longer to generate the page at /de/ than the page at /, possibly as a result of some WPML setting. This is true even for the .de domain, for it’s doing nothing but forwarding the URL to the /de/ URL. You should contact WPML support about this.

What you could do with CF to mitigate this slowness is to create a page rule with a Cache Level of Cache Everything for your /de/ home page. Since your page must be different for logged in and logged out visitors, please search this community and the support knowledge base for tips about doing it. There’s a combination of plugin and workers that may be useful to help new, logged-out visitors get the page faster.

Also, when testing a page on tools such a Pingdom, remember to always use the canonical URL to avoid unnecessary redirects. Most people will reach your site through Google, and it has the canonical URLs (with https and www), so that’s what you want to test. It’s also important to chose the server closest to the main audience of your website. Since HTML content is fetched by Clouflare from the origin, if you test a page out of Japan, it will give you an unrealistic reading of the speed most visitors are experiencing

I’d like to add that there were performace issues in Frankfurt which have been marked as resolved at 14:25 UTC

https://www.cloudflarestatus.com/incidents/rz0f6mvcr47y

1 Like

Hi Floripare,

this is exactly what I need AND I hope you would be available for me to solve this.
Are you may able to do those necessary settings for me?

I am looking forward to proceed with your further assistance.

Best, Alex

Hi Alex,

This is a community of volunteers, and I’m just one such volunteer. You can surely post here specific difficulties you may face while using Cloudflare resources, and we will be glad to help if we can.

That said, of the two solutions I mentioned, I’ve never used the plugin + Workers solution myself, as my sites don’t require login in the front end, but that seems to be the most appropriate solution for your use case if you can dole out the $5/month to enable Workers.

What you need to do is install the plugin that I linked to, enable Workers and follow their instructions, then post here any difficulties you may encounter so that a volunteer may help you with it. Any Workers-specific question you may have you should perhaps post to a different thread under Developers > Workers category, so that it catches the eyes of those more familiar with it.

This Github page has a pretty clear set of installation instructions:

Hi Floripare,

I am almost ready with the worker installation, but I stuck in some case I am not aware of.

  1. installed both plugins and unzipped within wordpress > plugins folder
  • cloudflare-page-cache
  • worker-examples-master
  1. I used the API instal instruction and added my credentials into the script.

I setup my own worker >
Screenshot > https://www.screencast.com/t/Bb9PlVnGHj
Screenshot > https://www.screencast.com/t/cic9qakK

But it seems that I am missing something to get it to run. i.e. Wasm or Wrangler or KV or I do not know.
Screenshot > https://www.screencast.com/t/mJg0LVX8iTh
I would appreciate your helping hands

Best, Alex

Hi Alex,

I’m glad things are moving. I believe your route needs to include www. before the domain, otherwise it won’t apply to your canonical URLs. Also, if you are redirecting from naked domain to www, setting the route to www will save you a bit of your Workers traffic quota, as any bot trying to navigate to naked domain will be redirected without triggering the Worker until it requests the www. URL.

As far as KV is concerned, this Worker’s documentation says KV is optional. Since it’s billed extra (another $5/mo), it’s up to you whether or not to use it. You can start without it and see how it goes.

Hi Floripare,

Thanks again for your helping info.

As we are a startup and unable to spend money as long our site is not making money I plan to use cloudflare workers without spending costs.

You stated that I need to purchase the ultimate plan 5USD/month but,
Is there a way to use workers without cost to start and to see how it works?

I plan to proceed by

  1. using html-edge-cache
    by using this instructions > https://github.com/cloudflare/worker-examples/tree/master/examples/edge-cache-html#Installation and installing at wordpress > https://github.com/cloudflare/worker-examples/tree/master/examples/edge-cache-html/WordPress%20Plugin

How am I able to flush the cache on all cloudflare servers if needed?

  1. installing workers on my server by using this instruction > https://developers.cloudflare.com/workers/sites/start-from-existing/

I am looking forward to you helping hands.

Best, Alex

I’ve recently written a couple of blog posts on this, which may help you…

https://www.riklewis.com/2019/10/cloudflare-full-page-caching/
https://www.riklewis.com/2019/10/cloudflare-full-page-caching-part-2/

There is now a free tier for Workers which you can use…

Free $0

For personal use and simple applications

Plan features:

  • Includes 100,000 requests per day (UTC+0)1
  • Up to 10ms CPU time per request
  • Lowest latency after the first request
  • Up to 30 Workers
1 Like

In answer to this question, the Wordpress plugin that you install will handle cache flushing for you automatically, in conjunction with the Worker script, using HTTP headers. Without KV, the whole cache will be flushed when a change is made, but with KV only the appropriate page will be flushed (which is the advantage of using KV).

However, if you want to flush the whole cache then you can do this in the Caching tab of the Cloudflare console. Clicking the “Purge Everything” button will purge the Worker cache as well as the asset cache.

1 Like

I’d suggest you definitely try the Workers Free Tier to see if works with your solution, it will depend on things like traffic volume and how many requests a page makes.

However, as @riklewis has pointed out, the beauty of the paid solution Workers + KV is that it will only purge HTML content, as opposed to purging everything—something that if done often could in fact make your site slower rather than faster.

You’d need to try it out.

1 Like

2 posts were split to a new topic: Need help to finish setting up Cloudflare Edge Cache