如何使用Google Cloud CDN访问Google Cloud Storage公共对象 [英] How to use Google Cloud CDN to access Google Cloud Storage public objects

查看:711
本文介绍了如何使用Google Cloud CDN访问Google Cloud Storage公共对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些从Google云端存储(GCS)提供的公开二进制文件,并希望探索使用Google Cloud CDN以降低延迟。我在创建GCS对象时通过设置适当的HTTP头来使用GCS缓存。

I have some public binary files that are served from Google Cloud Storage(GCS) and would like to explore usage of Google Cloud CDN for lower latencies. I am using GCS caching by setting appropriate HTTP headers when creating GCS objects.

是否可以使用Google Cloud CDN从GCS提供这些对象?如果不是,Google Cloud CDN仅适用于HTTP(S)负载均衡器吗?

Is it possible to use Google Cloud CDN to serve these objects from GCS? If not, does Google Cloud CDN only works with HTTP(S) load-balancers?

推荐答案

默认情况下边缘缓存,所以我建议您通过实验来衡量您的性能是否足够好以至于需要CDN。

Google Cloud Storage does provide an amount of edge caching by default, and so I advise you to experimentally measure whether your performance is already good enough to need a CDN.

也就是说,Google Cloud CDN和Cloud Load平衡器支持GCS存储桶作为后备资源,尽管该功能处于测试阶段。完整的说明如下: https://cloud.google.com/compute/docs/load-balancing/http/using-http-lb-with-cloud-storage

That said, Google Cloud CDN and Cloud Load Balancer support GCS buckets as a backing resource, although the feature is in beta. The complete instructions are here: https://cloud.google.com/compute/docs/load-balancing/http/using-http-lb-with-cloud-storage

要进行设置,请像往常一样配置Google Cloud负载平衡器,但作为您的备用存储桶,指定一个GCS存储桶并指定应使用Cloud CDN,如下所示:

To set things up, configure a Google Cloud Load Balancer like usual, but as your backing bucket, specify a GCS bucket, and specify that Cloud CDN should be used, like so:

gcloud beta compute backend-buckets create static-bucket \
    --description "A Bucket" \
    --gcs-bucket-name [EXAMPLE_BUCKET] \
    --enable-cdn

这篇关于如何使用Google Cloud CDN访问Google Cloud Storage公共对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆