Azure CDN URL 重写不适合缓存

标签 azure caching cdn http-caching azure-cdn

我正在尝试在另一个 CDN 之上设置 Azure 标准 CDN(不要问),并且我有以下重写 url 操作来映射路径:

enter image description here

它正在工作,但 Azure CDN 不会缓存响应,即使我有带有显式缓存覆盖的第二个操作。我的 Azure CDN 中的查询字符串缓存行为设置设置为“缓存每个唯一 URL”。我错过了什么?

这是我得到的响应 header :

HTTP/2 200 OK
cache-control: private, no-transform, immutable, max-age=604800
content-length: 48247
content-type: image/jpeg
last-modified: Thu, 18 Jun 2020 10:40:13 GMT
accept-ranges: bytes
etag: "ca5d81db6ff9266ad8fb95bc0e0daf33"
vary: Accept,User-Agent
server: Cloudinary
x-cache: TCP_MISS
x-request-id: b2bc7991c7f737acf00e07627c4e0d9a
strict-transport-security: max-age=604800
server-timing: fastly;dur=1;start=2020-06-18T17:34:56.853Z;desc=hit,rtt;dur=1
timing-allow-origin: *
access-control-allow-origin: *
access-control-expose-headers: Content-Length,ETag,Server-Timing,Vary
x-azure-ref-originshield: 0wKXr....
x-azure-ref: 0wKXr...
date: Thu, 18 Jun 2020 17:34:56 GMT
X-Firefox-Spdy: h2

cache-control 设置为 7 天(原始 CDN 默认值),Azure 的 x-cache 始终为 TCP_MISS :(

最佳答案

收到 Microsoft 支持人员的回复:

a web page response marked as private can be cached by a desktop browser, but not a content delivery network (CDN).

基本上,Azure CDN 遵循 cache-control: private 并且不允许更改行为。唯一的选择是修改原始响应。

关于Azure CDN URL 重写不适合缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62456434/

相关文章:

php - 使用 Azure 存储 PHP SDK 时为 "One of the request inputs is out of range"

caching - Umbraco 不会从缓存中清除损坏的代码

java - 基于 Spring 的单个 ehcache 管理器,用于多模块项目中的多个 ehcache.xml 文件

javascript - 如何覆盖托管在 CDN(其他地方)中的 javascript 库所需的文件?

jquery - 有没有可以通过 CDN 获取的 block ui jquery 库?

google-drive-api - 如何使用 Google Drive 作为一种 CDN

azure - 如何为azure linux VM上托管的nodejs应用程序设置自定义域名

azure - 为 Azure API 管理配置动态 header 值

c# - SQL Server Azure "Login failed for User"

php - Laravel 缓存大量查询