You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CloudFront白名单CloudFront-Is-Mobile-Viewer头部后的缓存逻辑咨询

CloudFront缓存与CloudFront-Is-Mobile-Viewer头部的关系

Hey Manish, nice to help you clarify this—let’s get straight to the point:

When you add CloudFront-Is-Mobile-Viewer to your cache key whitelist, CloudFront will only maintain cache entries based on whether the request comes from a mobile device, not every individual user agent string.

Here’s why this works the way it does:

  • CloudFront-Is-Mobile-Viewer is a CloudFront-generated request header that only has two possible values: true (for mobile devices) or false (for non-mobile devices). It’s CloudFront’s standardized way of flagging mobile vs. non-mobile traffic, based on its own parsing of the original User-Agent header.
  • Unlike whitelisting the User-Agent header (which would create a unique cache entry for every distinct user agent string—leading to way more cache entries and potentially lower hit rates), using CloudFront-Is-Mobile-Viewer keeps your cache logic clean and efficient. You’ll only have two separate cache groups: one for mobile users, one for desktop/non-mobile users.

This is actually a great approach if you need to serve optimized content to mobile vs. non-mobile visitors without bloating your cache with too many redundant entries.

内容的提问来源于stack exchange,提问作者Manish Kumar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:13:38