google-cloud-storage - 如何使用 Google Cloud CDN 访问 Google Cloud Storage 公共(public)对象

标签 google-cloud-storage google-cloud-platform google-cloud-cdn

我有一些由 Google Cloud Storage (GCS) 提供的公共(public)二进制文件,我想探索使用 Google Cloud CDN 来降低延迟。我通过在创建 GCS 对象时设置适当的 HTTP header 来使用 GCS 缓存。

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

最佳答案

默认情况下,Google Cloud Storage 确实提供了大量的边缘缓存,因此我建议您通过实验测量您的性能是否已经足够好,需要 CDN。

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

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

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

关于google-cloud-storage - 如何使用 Google Cloud CDN 访问 Google Cloud Storage 公共(public)对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42691577/

相关文章:

java - 如何将文件包装为 blob 并将它们作为数据存储提交到 Google App Engine Java 中

python-3.x - Cloud Storage python客户端无法检索存储桶

google-cloud-platform - 无法通过 Terraform 使用 GCP Cloud Build 验证 GitHub 存储库

ssl - 在没有 Google 存储桶的情况下使用 Google 的 Cloud CDN

google-cloud-storage - 删除对象名称为 "."

google-app-engine - Google Storage 或 Amazon S3 或 Google App Engine BlobStore

google-cloud-platform - Google Cloud CDN 开始忽略存储桶的查询字符串

google-cloud-storage - 适用于 Google Cloud Storage Bucket 的 Cloudflare CDN

port - 如何使用 gcloud CLI 在 GCP 中的 HTTP 负载均衡器的后端服务中添加/更新后端的端口

ubuntu - 如何利用 Google Cloud VM Instance 中的所有磁盘空间?