Book Image

Heroku Cookbook

By : Mike Coutermarsh
Book Image

Heroku Cookbook

By: Mike Coutermarsh

Overview of this book

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku. This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.
Table of Contents (17 chapters)
Heroku Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Serving assets from Amazon Web Services (AWS) Cloudfront


We can drastically reduce the number of requests to our dynos by having all the static assets of our application served by a Content Delivery Network (CDN). Static assets are the images, CSS, and JavaScript used by our application. Using a CDN is a huge performance win for any application. It helps us by freeing up our dynos from serving static assets, and it also gets our assets to our users' machines faster.

In this recipe, you will learn how to take an existing Rails application and have its assets served by AWS Cloudfront for speedy delivery to users.

Getting ready

For this recipe, we will need an AWS CloudFront account.

Visit http://aws.amazon.com/cloudfront/ to sign up now. Alternatively, if you have an existing AWS account, you can sign in.

How to do it…

We'll need to set up a CloudFront distribution and make a few minor changes to our Rails application. Let's get started by opening a browser and configuring CloudFront first, using...