DNS help for NooB

I have no idea what I’m doing but I don’t think it should be that hard. (Yes I have read some tutorials and the cloudflare help but nothings worked well for me.)

Rather then say all the things I’ve tried hopefully if I explain exactly what I’m trying to achieve someone can tell me how to get there. It may even help others.

    • I’m hoping to use cloudflare to cache responses near clients.
    • The API is used by applications so it doesn’t matter if the URL is ugly. However I did purchase a domain name through cloudflare - lets call it: www.domain.com
    • I have a free cloudflare account.
    • The outcome I want is a URL which will use the cloudflare cache if its available and failing that run the api link above (which cloudflare won’t let me post again cause that would exceed its two links per post for noobs policy.) . Preferable using my domain name if that’s practical and not going to badly impact performance.

No matter what arcane combination of DNS settings and page redirects I use it just doesn’t seem to work how I want. Can anyone help??

PS I could use the domain for something else…if its practical not to use it I’d be interested in knowing that.

Cloudflare only caches content from your own domain. If that API is at a third party domain, you could write a Cloudflare Worker (generally in Javascript) that would route this resource and make it cacheable.

Keep in mind that Cloudflare doesn’t cache responses for a long time unless they’re frequently accessed through that Cloudflare datacenter.

Oh I might have to look into that. I thought I could use (forward?) my domain to the API. (I wrote the API its in the cloud, it will mostly be accessed by mobile devices.)

My purpose for a CDN was to sit it over the API.

1 Like

This makes me wonder if cloudflare is the service for me at all. How long is “not very long” it may not be worth me bothering with this at all…

It depends on a lot of things, your current plan, and the data center its self. In my experience it’s usually around 12-24 hours but can be a lot less. Data centers will evict cache of free-plan customers to make room for Pro/Business/Enterprise customers

12-24 hours could make a big difference. However I don’t have access to the domain so it seems I cannot do anything