开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜