简体   繁体   English

在 Microsoft azure 存储上设置 Blob 磁盘缓存

[英]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 缓存规则除外),请检查以下方法:

Using Azure Storage Explorer使用 Azure 存储资源管理器

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 -> 保存。

Using Azure PowerShell使用 Azure PowerShell

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 ”。

Using Azure CLI使用 Azure CLI

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:请检查这些参考资料是否有帮助:

Ref1 , Ref2 . 参考 1参考 2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为 Microsoft Azure Blob 存储自动化 Snowpipe - 错误:找不到通道的队列 - Automating Snowpipe for Microsoft Azure Blob Storage - error: Queue not found for channel 将 CSV 从 Azure Automation 导出到 Microsoft Teams 而不是 blob 存储? - Export a CSV from Azure Automation to Microsoft Teams instead of blob storage? 如何使用环境变量为浏览器实现 Microsoft Azure Blob 存储? - How to implement Microsoft Azure Blob storage for browser with environment variables? 测试 Azure Blob 存储 SDK - Testing Azure Blob Storage SDK Azure Blob 存储文件访问 - Azure Blob Storage file access 如何在Azure中设置逻辑应用,根据名称将文件从blob存储传输到sharepoint? - How do I set a logic app in Azure to transfer files from blob storage to sharepoint based on the name? 无法从 Azure Blob 存储检索图像 - Could not retrieve image from Azure Blob Storage windows azure 开发存储 blob 服务未启动 - windows azure development storage blob service not starting 连接到自定义域上的 Azure blob 存储 - Connect to Azure blob storage on custom domain 如何从 azure blob 存储中读取“.owl” - How to read an ".owl" from azure blob storage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM