Heroku

How It Works

Handling Large Static Assets

Last Updated: 02 February 2011

constraints s3 static assets

Heroku is not intended to be used to serve large static assets such as videos, PDFs, or mp3s. The good news is that there are many excellent services that work extremely well for this, so you can integrate your app with one of those. Perhaps the best-known is Amazon S3, and it is the one we recommend.

To use S3 with your Heroku app, upload your assets to your S3 account using the command line or a graphical browser like the Amazon S3 Organizer add-on for Firefox or the S3Hub app for OS X. Once uploaded, you can make your assets public. Take the URL, which will be something like http://s3.amazonaws.com/bucketname/filename, and paste it into your app’s views wherever you need to serve the asset to your users.

For information on uploading files to S3 through your application, take a look at our tutorial.