使用单个存储桶优化页面加载(Optimising page loads using a single storage bucket)

编程入门 行业动态 更新时间:2024-10-17 11:22:27
使用单个存储桶优化页面加载(Optimising page loads using a single storage bucket)

我有一个Google云端存储桶mywebsite-static 。 由于浏览器对最大并行HTTP连接的限制,我想创建多个DNS记录,以便我可以使用static.mywebsite.com , static2.mywebsite.com等访问此存储桶中的文件。

文档建议添加CNAME记录,但存储桶名称必须与CNAME匹配。 保持一个桶中的内容可以在静态内容更改时保存同步/更新多个桶,并且也比存储相同静态内容的多个副本更清洁。

有什么方法可以创建多个DNS记录以便到达单个存储桶?

I have a Google Cloud Storage bucket mywebsite-static. Due to browser restrictions on max parallel HTTP connections, I would like to create multiple DNS records in such a way that I can access files within this bucket using static.mywebsite.com, static2.mywebsite.com, etc.

The docs recommend adding CNAME records, but the bucket name must match the CNAME. Keeping content in the one bucket saves synchronising/updating multiple buckets when the static content changes, and is also much cleaner than storing multiple copies of the same static content.

Is there any way to create multiple DNS records in order to reach a single storage bucket?

最满意答案

不与GCS单独。 但是,使用Google Cloud Load Balancing,您可以设置一个全局转发规则,它们都映射到单个后端GCS存储桶。 这将为您提供一个IP地址,您可以根据需要映射到尽可能多的DNS名称。 https://cloud.google.com/compute/docs/load-balancing/http/global-forwarding-rules

Load Balancer是一个功能强大的工具,也可用于替换您所服务的GCS存储桶,或者让您从GCE或其他服务动态地提供某些目录。

缺点是对于你的用例来说可能是过度的,配置这个有点复杂,全局转发规则并不便宜,但它会完成工作。 查看其他选项来改进您的网站可能会更容易,例如CSS精灵表。

Not with GCS alone. However, using Google Cloud Load Balancing, you could set up a global forwarding rules which all map to a single backend GCS bucket. This will give you an IP address that you can map to as many DNS names as you like. https://cloud.google.com/compute/docs/load-balancing/http/global-forwarding-rules

The Load Balancer is a powerful tool and can also be used to swap out which GCS bucket you're serving from or let you serve some directories dynamically from GCE or other services.

The downsides are that may be overkill for your use case, configuring this is somewhat complicated, and global forwarding rules aren't cheap, but it will get the job done. It might be easier to look into other options to improve your site, such as CSS sprite sheets.

更多推荐

本文发布于:2023-08-06 23:30:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1456693.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   页面   Optimising   page   bucket

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!