Recently I have had to build several high performance websites.
These sites were simple sites but were heavy in images and we were
expecting large amounts of traffic. I was using heroku to host the
sites so I could easily scale to a large number of dynos but why
have all of the excess http request for all of the assets hit my
heroku app too.
So I knew I was going to offload all of my images, css, fonts, and
javascript onto s3 and maybe even run cloudfront to speed things up
further, but managing:
- copying all of those assets to s3
- being sure that every time I change an asset I upload it to S3
- managing the urls to the assets
was going to be a pain in the ass.
Luckily with the help of Rails 3.2’s asset pipeline and a little
gem called ‘asset_sync’ everything can be made much simpler.
Read on →