Cloudflare 'Websites' and 'Workers & Pages'

Hi beginner here. I currently have a static site hosted using 'Workers' with a custom domain. I also have that same domain under the 'Websites' section. What is the relationship between the two? My issue is that the site is running a bit slow. Will paying for cloudflare premium or making optimizations under 'websites' improve my website hosted on 'workers'. Thanks so much
18 Replies
Chaika
Chaika9mo ago
What is the relationship between the two?
Websites are known internally as "Zones" to Cloudflare. With a free account, every "Website" you add is using Cloudflare Nameservers/DNS, and also Proxy/CDN if you have that enabled for each DNS Record. There is no direct relationship between Websites and Workers. Workers are serverless scripts running on Cloudflare's Edge. Websites are using Cloudflare's DNS/CDN Services. How exactly do you have your website setup? Are you sure you're using a Worker, and not Cloudflare Pages, or some external host?
kevinm
kevinmOP9mo ago
I did a direct upload of my files under pages. The only other thing I did was add my custom domain and updated my dns records at my registrar
Chaika
Chaika9mo ago
Ok you are using Pages then, not Workers Pages is its own product, although Workers & Pages are under the same tab (You don't need to update your DNS Records at your Registrar, as long as you are using CF DNS and have your nameservers at your registrar set to CF) Can you clarify what you mean by "your site is running a bit slow"? In what way? If you can share the link it would be helpful as well
Walshy
Walshy9mo ago
Fast for me, all assets <80ms
kevinm
kevinmOP9mo ago
I see, so i shouldnt worry?
Chaika
Chaika9mo ago
What do you see/why do you think it's slow?
kevinm
kevinmOP9mo ago
Occasionally, the text/images on the hero section will load in after the icons such as the location pin, review stars etc also some of the bigger "banner pictures" will load slowly from top-bottom Seems to be fine right now
Chaika
Chaika9mo ago
Some of those images are huge/you should compress them. CF Pro has Polish which could help you out, but you'd probably be better off just pre-compressing them smaller to begin with
Chaika
Chaika9mo ago
No description
kevinm
kevinmOP9mo ago
Ah I see thanks so much!
Chaika
Chaika9mo ago
you can throw loading="lazy" attribute on them as well (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#lazy), and they'll only load when they are visible
kevinm
kevinmOP9mo ago
And to circle back to my question. Would premium be worth it for my use case? Or would doing a couple optimizations on my end be enough?
Chaika
Chaika9mo ago
You mean Pro plan? Probably not I don't think
Walshy
Walshy9mo ago
Yeah routing or similar isn't the issue here, more like larger images. Basically all assets are good, the large images are expectedly slower Pro could help as you can use Polish which Chaika mentioned earlier but you can also optimise at source rather than inflight
Chaika
Chaika9mo ago
Google is currently mostly upset about all the images being huge size https://pagespeed.web.dev/analysis/https-junkclinic-com/exsao7ht3p?form_factor=desktop In both Chrome & in Firefox if you pop open dev console (ctrl+shift+i), you can go to Network and simulate a slow network which can help with optimization/seeing how bad it might be for some users Polish can automagically convert to modern formats/webp on the fly as well if supported by the user's browser but I would use a tool to compress them down to an acceptable level and then see, probably not worth paying $25/mo for Pro, just for that
kevinm
kevinmOP9mo ago
Thank you so much, I appreciate your time!
Want results from more Discord servers?
Add your server