node.js - Azure Blob 存储 SAS ExpireOn 不起作用
问题描述
已解决,是浏览器缓存
我正在尝试从 Azure Blob 存储中获取图像,由于某种原因,ExpireOn 无法正常工作,我可以正常访问图像,但在过期时间过后,它不会使链接失效。
import { BlobSASPermissions, generateBlobSASQueryParameters, StorageSharedKeyCredential} from "@azure/storage-blob";
export async function BlobService2(){
const accountName = process.env.ACCOUNT_NAME;
const containerName = process.env.CONTAINER_NAME;
const blobName = process.env.BLOB_NAME;
const accountKey = process.env.ACCOUNT_KEY;
const SharedKeyCredential = new StorageSharedKeyCredential(accountName , accountKey)
const blobSAS = generateBlobSASQueryParameters({
containerName, // Required
blobName, // Required
permissions: BlobSASPermissions.parse("r"),
startsOn: new Date(), // Required
expiresOn: new Date(new Date().getTime() + 5*60000)
},SharedKeyCredential).toString();
const URL = `https://${accountName}.blob.core.windows.net/${containerName}/${blobName}?${blobSAS}`
console.log(URL);
}
解决方案
@Henrique E,感谢您确认您的问题已通过清除浏览器缓存得到解决。
感谢@GauravMantri 和@JohnHanley 提供您的建议。
推荐阅读
- asp.net-core - Razor 页面表单提交禁用提交按钮,但如果表单具有客户端验证,则无法启用它
- java - Spark 读取 .7z 文件
- sql - 将 XML 转换为 SQL Server 表(cfdi 文档)
- javascript - 奇数和偶数的和与差
- python - 在python中跨列多列
- vba - 如何循环访问 MS Access 数据库并锁定所有表
- python-3.x - python 虚拟环境是完全独立的吗?
- python - 如何从 urlopen() 响应返回 JSON 格式?
- php - PHP 计算嵌套数组中的唯一值
- c# - 完全加载后,不会为 ContentControl 的新设置内容触发 Loaded 事件