Choose CDN edge locations

So it looks like Google finally made it possible to use external sources as an origin for their CDN, although it still feels wrong and overcomplicated… But, I would totally be okay using Google Cloud CDN for HTTP content if I was able to choose the locations that content is cached at. Instead of being forced to use all 20 or more locations in the United States as caching locations, is there a way I can limit it to like 4 places to increase cache hit ratio? I guess it’s fine if there’s a feature that allows all content on your site to be synced with all locations, but the ideal solution would be 1 or a couple of caching locations rather than 20 or more.

Fastly sort of has this feature, but I’m not sure about others.

Dallas, Texas - Ashburn, Virginia - New York City, New York - Chicago Illinois - and probably California would likely be ideal locations, but even 1 single location could easily work.

So, the question in full, is it possible to choose the edge locations in which your website content is cached (directly) or are we all forced to use the worldwide anycast network and all locations with Google Cloud CDN?

Surely I’m not the only person who’s ever wondered this, and I’m curious to know what you think of this idea. Thanks!

1 Like

bump bump

Hi,

There is no way today to limit edge locations. Caching occurs using GFE’s, Google Frond End’s. As you say access to the GFEs is via and anycast IP, which means clients are routed to the closest site to them from a network topology standpoint. Ordinarily the diversity of sites should be a good thing, because you ensure content is served from as close to the user as possible, minimising latency and improving client performance. Equally if you don’t have clients from say Europe accessing the platform, then requests will never hit a European GFE and so no corresponding request to your origin will be made.

You reference even one single location would easily work for you, which implies you might be trying to solve a different problem? As typically CDN’s are there to improve client performance, so the more edge locations the better, but a single location would add little to improve a client experience compared to simply the origin located in the right geo.

As an aside, though I’m sure you’re already aware, another way to improve hit ratios is to extend the max-age of the items being cached, that way they live longer in the cache.

All the best,

Alex

3 Likes

Thanks! So now I’m looking at Google webservers. Google has ‘fife’ and ‘sffe’ server, which seem to be servers only Google has access to, but App Engine is served from the same ip ranges as fife & sffe (or so it appears). Would it be better to cache with App Engine, because that seems like what Google is doing and it seems like it’s possible. It’s not like I have an app ready to deploy though, this is really just out of curiosity.

Finally, is there a difference between the 142.0.0.0 and 216.0.0.0 ip ranges? I also can’t get over the fact that this is a Google owned website, but it’s hosted at AWS and uses Cloudfront.

Sorry for all the questions, but I’ve had these questions for quite some time now!

Are you able to take a step back and elaborate what your requirements are in more detail? that might help zero in on potential solutions.

Like I said, it’s really just out of curiosity. I did find this though. Netlify is using google cloud cdn (apparently), but they were able to get a single location in Iowa.

https://vitepress.vuejs.org/

IP: 35.222.205.150

Is this a contract or something? Because I would love to use Google CDN for any future projects, but I just want to serve it from a single location to maximize cache hit ratio.

I also have done some more looking and found this.

https://staging-api.edgegap.com/ resolves to 35.203.10.204 which is 204.10.203.35.bc.googleusercontent.com) in Montréal, Quebec, Canada. There must be a way to get this with Google Cloud.

As per my earlier note. Are you able to elaborate what your requirements are and what challenges you are trying to solve further? that might help point to possible solutions.

I am also very curious about this @alexmoore since you mention perfomance is the main reason to keep all edges active. We are facing performance problems exactly because of this behavious. We deploy several times per day/week and this means all the edge caches are reset and only if there is enough traffic in a specific region the edges get really warmed up. this leads to the odd behaviour that the google bot is our main visitor on a lot of edges which makes SEO indexing slow since the first call takes several 100ms by the bot. we would love to limit the edges to our main traffic areas so that the google-bot is not landing on cold caches all the time.