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

Using Heroku Deflater to gzip assets


One of the quickest ways to increase web performance is to enable GNU Zip (gzip) for our assets. It's a file compression format that can reduce the size of our HTML, CSS, and JavaScript assets by up to 70 percent. It only takes a couple of minutes to be enabled. In this recipe, you'll learn how this can be done.

Getting ready

Before adding gzip to our application, it can be interesting to run a benchmark so that we can compare our application before and after the change.

We can do this in our browser with YSlow. For installation instructions, visit https://developer.yahoo.com/yslow/.

Once installed, we can run a test and then click on Statistics to see a pie chart that shows our page weight.

Running this before and after will show what a huge impact gzip has on web performance.

How to do it…

All we need is one additional gem to start serving the gzipped assets on Heroku. Open a terminal and navigate to our example application, the Blogger app, by performing...