开发者

Why isn't a JS file hosted on Amazon S3 getting cached by the browser?

开发者 https://www.devze.com 2022-12-29 00:33 出处:网络
I have a JS file hosted on Amazon S3 (http://s3.amazonaws.com/wingify/vis_opt.js). I want the file to be cached on users\' browsers so that they don\'t have to download it with every page view. Howeve

I have a JS file hosted on Amazon S3 (http://s3.amazonaws.com/wingify/vis_opt.js). I want the file to be cached on users' browsers so that they don't have to download it with every page view. However, in spite of setting Cache Control header I don't think it is getting cached. Browser still contacts Amazon Server with every pageview.

Here is the example of page where this script is embedded: http://myjugaad.in/

If you have Firebug, you will be able to see that browser requests it with every pageview.

What can I do s开发者_JS百科o that the file gets permanently cached? Thanks for help.


You need to set the Cache-Control header when upload your files.

This tells your browser how long it can cache the file for.

0

精彩评论

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