views:

58

answers:

1

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 so that the file gets permanently cached? Thanks for help.

A: 

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

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

Scrappydog