Windows Azure Storage (9) Windows Azure 上的托管服务CDN (中) Blob Service

 《Windows Azure Platform 系列文章目录

 

 

  本文介绍的是国外的Azure Global

  如果你使用的是国内由世纪互联运维的Azure China,请参考这篇文章:

  Azure China (9) 在Azure China配置CDN服务

 

  

  本节我将介绍如何在Windows Azure平台下使用CDN。

  Windows Azure平台提供了Blob Service和Hosted Serive两种CDN服务。我这里简单介绍Blob Service的内容。

  请参考《Windows Azure Platform (十四)Windows Azure Storage Service存储服务之Blob详解(上)

  和《Windows Azure Platform (十五)Windows Azure Storage Service存储服务之Blob详解(下)》的例子,在Windows Azure Blob Storage下上传一张图片。

  您也可以使用Azure Storage Explorer这个工具,来上传您需要的图片。

 

  我上传到Azure Storage的图片URL是这样的:http://threestone.blob.core.windows.net/gallery/WindowsAzure.png

  其中threestone是我的存储账户(Azure Storage Account)。对此内容不熟悉的网友可以看我之前几章的内容。

  上传成功的图片预览如下:

  接下来我要做的是,让所有存在Azure Storage账户threestone下的内容,开启CDN。

  我们登陆到Windows Azure Management Portal里,选择"托管服务、存储账户和CDN"-->选择"CDN",然后选中threestone这个存储账户,选择"新建终结点"。

 在弹出的"新建CDN终结点"里,最下面的勾选框,选择启用CDN、HTTPS、查询字符串(注:截图有点问题,抱歉)。最后点击"确定"。

 Windows Azure会提示您,启动CDN可能需要60分钟。不过根据笔者观察 ,只需要差不多20分钟左右。

关闭"启用CDN"窗口之后,你会在Storage下发现CDN终结点已经创建。

CDN的地址是az271846.vo.msecnd.net

其中CDN URL为az271846.vo.msecnd.net。

我原来使用Azure Storage保存图片的URL是http://threestone.blob.core.windows.net/gallery/WindowsAzure.png

开启CDN之后,地址就变成http://az271846.vo.msecnd.net/gallery/WindowsAzure.png

这样Blob Service里的所有Blob内容都会被CDN加速。

 

  用户首次访问这个图片的CDN URL的流程如下:

  • 当用户打开这个网页的时候,客户端首先向距离用户最近的CDN服务器请求这个资源。
  • 如果CDN服务器上海没有这个文件的副本,则通过配置信息从对应的Blob Service中请求这个资源。本例中,向http://az271846.vo.msecnd.net/gallery/WindowsAzure.png这个地址请求资源。
  • Blob Service得到这个Blob资源
  • Blob Service会首先把这个图片复制到CDN服务器
  • 图片将会通过CDN服务器返回给用户

  如果用户再次访问这个页面的时候,由于这时候CDN中已经有这个图片的副本了,所以将会直接从CDN服务器返回而无需访问Blob Service。

  随着更多的用户访问,大部分情况下这个图片已经缓存在CDN中了,因此几乎不会再需要向Blob Service请求,这样就提高了网站的执行性能。

  注意:只有通过CDN URL进行访问的时候才会使用CDN功能。如果用户直接访问的是Blob Service的URL,那么即使CDN服务器中已经缓存了这个资源,用户还是会直接从Blob Service获取这个资源。

 

  OK,距离我们创建CDN Endpoint差不多20分钟的时间了。让我们看一下CDN URL

  

 

分类: Azure Storage

本文转自Lei Zhang的博客博客园博客,原文链接:http://www.cnblogs.com/threestone/archive/2012/06/08/2541682.html,如需转载请自行联系原作者

来源:https://yq.aliyun.com/articles/382898


智能推荐

Windows Azure Storage (5) Windows Azure Drive

  《Windows Azure Platform 系列文章目录》     在开始此次教学之前,我强烈建议大家先学习Windows Azure中文博客:Windows Azure 入门教学系列(八),使用Windows Azure Drive。   入门教学的例子非常简单:Windows Azure平台提供了Drive的功能,就是把Windows Azure Blob Storage变成...

宣布降低Windows Azure Storage的定价

今天我们很高兴宣布Windows AzureStorage的又一次多达28%的降价,从12月12日有效。这是继2012年3月8日降价12%以后,对业内最佳总体价值的进一步承诺。 降低价格只是事情的一部分;我们还以多种方式向我们的存储产品增加价值。我们的地理冗余存储继续在超过400英里的副本之间领先市场。我们最近宣布 一个跨多个数据中心的WindowsAzure平面网络部署,这将提供很高的网络连接,...

宣布降低Windows Azure Storage的定价

今天我们很高兴宣布Windows AzureStorage的又一次多达28%的降价,从12月12日有效。这是继2012年3月8日降价12%以后,对业内最佳总体价值的进一步承诺。 降低价格只是事情的一部分;我们还以多种方式向我们的存储产品增加价值。我们的地理冗余存储继续在超过400英里的副本之间领先市场。我们最近宣布 一个跨多个数据中心的WindowsAzure平面网络部署,这将提供很高的网络连接,...

Windows Azure Storage (6) Windows Azure Storage之Table

 《Windows Azure Platform 系列文章目录》     最近想了想,还是有必要把Windows Azure Table Storage 给说清楚。     1.概念   Windows Azure Table是存储在云端的非关系型数据表,主要存储结构化数据,简单理解上来是类似SQL Server的一张单表,包含了列名和行数据,但是无法执行关系型运算(...

Windows Azure Storage论文解读

Windows Azure Storage论文解读 整体架构 文件流层 stream layer 存储引擎 存储优化 分区层 Partition Layer 存储引擎 WAS总结 WAS是微软开发的云存储系统,提供Blob、Table、Queue三种类型的服务,它广泛部署于微软内部。其论文发表于2011年SOSP。 整体架构 WAS主要分为两个部分:定位服务(Location Service LS...

猜你喜欢

Azure Blob Storage 基本用法 -- Azure Storage 之 Blob

Azure Storage 是微软 Azure 云提供的云端存储解决方案,当前支持的存储类型有 Blob、Queue、File 和 Table。 笔者在《Azure Table storage 基本用法》一文中,介绍了 Table Storage 的基本用法,本文将通过 C# 代码介绍 Blob Storage 的主要使用方法。 Blob Storage 是什么? Azure Blob Stora...

Windows Azure Cloud Service (12) PaaS之Web Role, Worker Role, Azure Storage Queue(下)

  《Windows Azure Platform 系列文章目录》     本章DEMO部分源代码,请在这里下载。     在上一章中,笔者介绍了我们可以使用Azure PaaS的Web Role和Worker Role来处理复杂的业务逻辑   -Web Role可以快速响应前端的业务请求,并将输入保存到Azure Storage Queue中   -Worker Role将数...

Python 操作 Azure Blob Storage

笔者在《Azure 基础:Blob Storage》一文中介绍了 Azure Blob Storage 的基本概念,并通过 C# 代码展示了如何进行基本的操作。最近笔者需要在 Linux 系统中做类似的事情,于是决定使用 Azure 提供的 Azure Storage SDK for Python 来操作 Blob Storage。这样今后无论在 Windows 上还是 Linux上,都用 Pyt...

如何更有价值采集数据、高效分析数据?

上回说到,用户行为数据的意义和价值《为什么要进行用户行为分析?》,以及互联网产品用户模型的构建,这其中就包含了对数据的采集和分析两大块儿,本文将从数据采集的三大要点、如何让分析更有价值更高效、以及数据分析思维三部分展开聊。 一、数据采集的三大要点 1、全面性 数据量足够具有分析价值、数据面足够支撑分析需求。 比如对于“查看商品详情”这一行为,需要采集用户触发时的环境信息、会...

shell脚本编程基础(三)

结构化命令(一) if-then和case语句。 If-then-else语句 当if语句中的命令返回非零退出状态码时, bash shell会执行else部分中的命令。 嵌套if-then语句的问题在于代码不易阅读,很难理清逻辑流程。 可以使用else部分的另一种形式:elif。这样就不用再书写多个if-then语句了。 elif使 用另一个if-then语句延续else部分。 elif语句行提...

问答精选

URL for a user content site and SEO

I was thinking about how i should write my URLs. I want them to A) Be user friendly B) SEO C) allow fast DB queries. The information i have are username, category, mediaId, title and other data i dont...

How to use the Clojure -> macro with an inner function

I'm a Clojure beginner and I want to understand the -> macro This code works: But this doesn't even compile and I don't know how to deal with the error message: CompilerException java.lang.IllegalA...

Java Program to make Tic Tac Toe not working

For my programming class I'm supposed to make a program that simulates a game of tic tac toe. My teacher provided all the methods and said we shouldn't need to add any or take any away, and told us we...

How can i exit the for statement in assembly

The purpose of this code is to flash the bits turned on three times, exit the loop and turn them off. Currently the code seems to be in an infinite loop and does not exit the loop after the count is 0...

Simple Camel test fails with no messages recieved

Am using Spring Boot and I have just added camel to it. I have a simple camel route setup : When I try to create simple test for this route with : It fails with Not sure what could be a problem here. ...

相关问题

相关文章

热门文章

推荐文章

相关标签

推荐问答