使用 Azure,我应该将静态共享 JS 和图像文件存储在包版本中还是 blob 中?
考虑速度和成本。 假设我有一些为多个网站共享的 JS 和图像文件。这不是巨大的图像文件,这只是一些静态文件,例如 PNG 精灵和常见的 JS 文件。 我有点迷失了选择: - 我应该将其保留在我的 webpackage 中以便在 Azure 中发布吗? - 或者我应该把它们放在 blob 中?
我不知道的是,如果我对 blob 解决方案有很多点击,它的成本可能会比对包的 IIS 级别的点击更多? 对、错?
编辑:我意识到将 JS 文件存储在 blob 上不会以 gzip 形式提供它?
Speed and cost in mind.
Say I have a few JS and images files shared for multiple websites. that is not huge images files, this is only few static files like PNG sprites and common JS files.
I'm kind of lost on the choice :
- Should i keep it in my webpackage to release in Azure ?
- Or should i put these in blobs ?
The things I don't know is if i have a lot of hits on the blob solution, it might cost more than the hits on the IIS level of the package ?
Right, wrong ?
Edit : I realize storing JS files on the blob won't deliver it gziped ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不需要我能看到的斑点。数据库往返并没有增加价值。我只是将静态内容放在网络服务器上并让它提供服务。在客户端指示它们可以处理 GZIP 压缩的情况下,让 Web 服务器负责压缩线路上的字节。
No need for the blobs that I can see. The database round trip isn't adding value. I'd just put the static content on the web server and let it serve it up. Let the web server handle compressing the bytes on the wire for those cases where the client indicates that they can handle GZIP compression.
你的JS和图片文件会经常修改吗?如果是这样,将它们放入服务包中意味着每次您想要更新这些文件时,您都必须重新编译服务包并重新部署您的实例。如果您发现自己需要经常更新,这将变得很麻烦。从速度的角度来看,您不会看到从博客提供文件或从网络角色提供文件之间有太大差异(假设文件实际上并不大)。最后但并非最不重要的一点是,从成本角度来看,如果您考虑一下 Blob 存储的成本(每月每 GB 存储 0.15 美元,每 10,000 个存储事务 0.01 美元),您会发现其实并不多。您的网站必须拥有大量流量,成本才会变得很高。
Will your JS and image files be modified often? If so, putting them into the service package would mean that every time you want to update those files, you will have to recompile the service package and redeploy your instance. If you find yourself needing to update often, this will become cumbersome. From a speed perspective, you're not going to see too much of a difference between service them files up from the blogs or serving them up from the web role (assuming the files are in fact not huge). Last but not least, from a cost perspective, if you look at the cost of blob storage ($0.15 per GB stored per month, $0.01 per 10,000 storage transactions), its really not much. Your site would have to have a lot of traffic for the cost to become significant.