[英]set blob disk cache on microsoft azure storage
i tried to set cacheControl value in azure CDN rules engine.我试图在 azure CDN 规则引擎中设置 cacheControl 值。 request header is added with cacheControl value (cache-Control: max-age 3000), but when i reload my page, blob is not caching by disk cache and download blob everytime.请求 header 添加了 cacheControl 值(cache-Control:max-age 3000),但是当我重新加载我的页面时,blob 没有被磁盘缓存缓存并且每次都下载 blob。 is there have any other setting for blob disk cache? blob 磁盘缓存是否有任何其他设置? (blob's url is combine with SAS Token) (blob 的 url 与 SAS Token 结合)
To set blob cache on Microsoft Azure Storage (other than Azure CDN caching rules), please check the below methods:要在Microsoft Azure 存储上设置 blob 缓存(Azure CDN 缓存规则除外),请检查以下方法:
Open Azure Storage Explorer -> Select blob -> Select properties -> Go to cache control property -> Enter value as max-age=3000 -> Save.打开 Azure Storage Explorer -> Select blob -> Select properties -> Go to cache control property -> Enter value as max-age=3000 -> 保存。
Use the Get-AzStorageBlob
cmdlet to get blob, then set the .ICloudBlob.Properties.CacheControl
property to " max-age=3000 ".使用Get-AzStorageBlob
cmdlet 获取 blob,然后将.ICloudBlob.Properties.CacheControl
属性设置为“ max-age=3000 ”。
In Azure CLI while uploading a blob, set the cacheControl property by using the -p
switch like below.在 Azure CLI 中上传 blob 时,使用-p
开关设置cacheControl属性,如下所示。
azure storage blob upload -c <connectionstring> -p cacheControl="max-age=3000" .\<blob name> <container name> <blob name>
For more in detail, please refer this link .有关更多详细信息,请参阅此链接。
Note:笔记:
Disk Caching is not supported for disks 4 TiB and larger. 4 TiB 及更大的磁盘不支持磁盘缓存。 If multiple disks are attached to your VM, each disk that is smaller than 4 TiB will support caching.如果多个磁盘连接到您的 VM,每个小于 4 TiB 的磁盘都将支持缓存。 Changing the cache setting of an Azure disk detaches and re-attaches the target disk.更改 Azure 磁盘的缓存设置会分离并重新连接目标磁盘。
Please check these references if they are helpful:请检查这些参考资料是否有帮助:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.