How to cache external Javascript files?

What are the ways to cache audio files on Amazon S3?

  • I have created new music application and I store all mp3 files on Amazon S3. Before moving to S3 I used store them on server file system itself. It used to cache files and on consecutive reload of page files weren't downloaded from server. But after moving to S3 everytime I load page it downloads files from S3. This not only making my app slow but every request to S3 is money. I found some documentation on cache-control and I tried them all but no success. I might be missing something here. Any help is appreciated. Thanks. I use CarrierWave with Rails.

  • Answer:

    You can make use of http://aws.amazon.com/cloudfront for distribution of your audio files. Not only it will make your app faster by doing a cache of the recently requested audio files, it will also be faster as it will serve the file from the nearest available location. Plus, it is very easy to integrate CloudFront with your S3 bucket.

Mohit R. Dhanjani at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.