我应该将我的静态资源从 App Engine 移动到 Google Cloud Storage 吗? [英] Should I move my static resources from App Engine to Google Cloud Storage?

查看:17
本文介绍了我应该将我的静态资源从 App Engine 移动到 Google Cloud Storage 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在 App Engine 中有一个网络应用程序.我想知道将我的静态资源(即图像、CSS 文件和 JS 文件)从 App Engine 中移出并从 Google Cloud Storage 提供它们是否是个好主意.

We have a web application in App Engine. I was wondering whether it is a good idea to move my static resources (i.e Images, CSS files, and JS files) out from App Engine and serve them from Google Cloud Storage.

我的想法有两个:

1) 我们可以利用 Google Cloud Storage 获得 CDN 的优势.我们甚至可以为每个文件配置元数据以设置过期标头、gzip 压缩等.此外,通过提供来自不同域的文件,我们可以让浏览器并行下载更多内容.

1) We can get the advantages of a CDN with Google Cloud Storage. We can even configure metadata for each file to set expiration headers, gzip compression, etc. Also, by serving files from different domains we can have browsers download more content in parallel.

2) 通过从 App Engine 卸载一些文件,实例消耗将减少(对 App Engine 的请求减少),因此成本将下降.

2) By off-loading some of the files from App Engine, the instance consumption is going to decrease (less requests to App Engine), so the costs will go down.

我说的对吗?这是明智之举吗?

Am I right? Is this a wise move?

谢谢,

推荐答案

这些都没有意义.

1) App Engine 的边缘缓存具有类似 CDN 的功能.不幸的是,它没有很好的记录.有一些关于它的 Google I/O 演讲.这是一个开始:http://eng.pulse.me/backend-tips-the-free-cdn/您也可以在 Google I/O 2012 上找到另一个演讲.如果您的静态文件被充分访问,它们将与边缘缓存一起提供,因此无需为此移动到 GCS.

1) App Engine has a CDN-like functionality with it's edge cache. Unfortunately, it's not well documented. There's a few Google I/O talks on it. Here's a start: http://eng.pulse.me/backend-tips-the-free-cdn/ There's another talk in Google I/O 2012 that you can find as well. Your static files will be served with the edge cache if they're accessed enough, so no need to move to GCS for this.

2) 有据可查的是静态文件不包含实例.你已经读过这篇文章,所以你的偏执狂"只是偏执狂,没有任何意义.通过将新版本上传到应用引擎、访问静态文件以及在 Admin 中检查新实例来进行测试也非常容易.

2) It's well documented that static files don't take instances. You've already read this, so you 'paranoia' is simply paranoia, and doesn't make sense. It's also very easy to test by uploading a new version onto app engine, accessing a static file, and checking for a new instance in the Admin.

这篇关于我应该将我的静态资源从 App Engine 移动到 Google Cloud Storage 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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