开发者

Change in Javascript/CSS not reflecting from CDN

开发者 https://www.devze.com 2023-04-09 12:12 出处:网络
I have setup CDN to fetch my images/js/css files. Initially to override browser cache behavior and to reflect the changes in my js/css files, I used to change the version in URL parameters to make it

I have setup CDN to fetch my images/js/css files. Initially to override browser cache behavior and to reflect the changes in my js/css files, I used to change the version in URL parameters to make it look like a different URL to the browser. Like http://mysite.com/scripts/common.css?v=45.

But after porting these resources to CDN, none of my changes reflect. CDN always returns the cached copy and it ignores the version parameters.

Please help. I开发者_StackOverflow中文版 am using Amazon cloudfront


If you're using CloudFront have you read:

https://forums.aws.amazon.com/thread.jspa?messageID=261072

It looks like it ignores the query string when caching the object. This is quite old information, but I've not read anything that tells me otherwise, so you'll have to modify the URL some other way (filename/path/etc).

They do provide an invalidation API. Using this might solve your problem depending on your release cycle.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号