简体   繁体   English

AWS CloudFront行为问题

[英]AWS CloudFront Behaviors Issue

I'm currently having an issue setting up a behavior in Amazon CloudFront. 我目前在设置Amazon CloudFront中的行为时遇到问题。

I want all files under a certain directory to hit a specific pattern and set the Object Caching to "Custom" and Minimum TTL to 3600. 我希望某个目录下的所有文件都命中特定模式,并将对象缓存设置为“自定义”,并将最小TTL设置为3600。

Sample Url: http://blah.com/images/default-source/test/test.jpg 示例网址: http//blah.com/images/default-source/test/test.jpg

I have a behavior setup as: Path Pattern: images/default-source/* (have also tried /images/default-source/*) Object Caching: Customize Minimum TTL: 3600 我的行为设置为:路径模式:images / default-source / *(也尝试过/ images / default-source / *)对象缓存:自定义最小TTL:3600

However, whenever I hit the sample Url, it returning a header of "Cache-Control: public, max-age=7776000". 但是,每当我点击示例Url时,它都会返回标头“ Cache-Control:public,max-age = 7776000”。

I feel like everything is configured correctly, but clearly something isn't working properly. 我觉得一切都配置正确,但是显然有些东西无法正常工作。

That setting doesn't overwrite the cache-control header - it just affects how long cloudfront (not the browser) caches objects. 该设置不会覆盖缓存控制标头-只会影响Cloudfront(而非浏览器)缓存对象的时间。

In any case it is just a lower bound - cloudfront uses the maxage value (unless it is less than the minimum ttl) 无论如何,这仅仅是一个下限-Cloudfront使用最大值(除非它小于最小ttl)

This table summarizes the behaviour but in short it sounds you'll need to set those cache-control headers yourself if you're not happy with the defaults something on your server is setting. 该表总结了该行为,但简而言之,如果您对服务器上设置的默认值不满意,则需要自己设置这些缓存控制标头。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM