简体   繁体   中英

Does cloudfront support questionsmarks at URLs to fetch a new resource

We are porting a website to a AWS cloudfront backed infrastructure which serves static resource from an S3 bucket.

We access the resource like this

http://example.com/static/foo.css?hash=1

Our CMS generates a new hash when the files changed (cachebusting).

So we upload the file foo.css to the S3 bucket and access

http://example.com/static/foo.css?hash=2

But still the old contents are displayed. It seems to be cached in cloudfront?

Can this be avoided?

Or does the cms need to be modified?

You have to configure your CloudFront distribution to forward query parameters and use them as part of the cache key. Documented here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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