We recently moved some of our processing from Engine Yard over to Contegix. The initial results are really positive – big boosts in our processing power and capacity. Part of the conversion, of course, is getting brand new servers setup (or as my coworker Justin calls it “Christmas Morning”).
There are lots of great stories to tell about what we’re creating and how we’re doing it but after reading an old coworkers post recently, I thought I’d share a few quick hitters that (can) provide significant performance boosts.
make stuff small.
As Shmueli eludes to: mod_deflate (previously mod_gzip) can really help out – most browsers can handle it these days and even with today’s connection speeds – smaller amounts of data == good. Our exclude list has a tad more to it than his example, but this tutorial has the basics.
don’t keep asking “is this old?”
Add an expires header (where possible). If you’re using Rails (a large percentage of our stuff does), it’s helper methods like to add 10 digit query strings to the end of static resources. Things like this:
There are several approaches you can find out there that can leverage that to really speed things up. I ended up with something along these lines. It does require a symlink that gets wiped out by our Capistrano deploy (so it needs to recreate it for me each time), but… I like it – and it’s been working great. It’s amazing how much faster and lighter things are when you let the browser use it’s cache a bit and not make so many needless requests.
I had more trouble than good with e-tags…
I decided against minifying the js – I think the added complexity of the process (making sure things are minified each time, the app points at the right stuff, etc) outweighs the benefit of a slightly smaller transmission, in our case.
We also don’t really have pages heavy enough with images to make sprites a worthwhile endeavor at this point — This was actually a disappointment to me. I haven’t had a chance to implement sprites yet and would really like to give them a real-world try at some point…
There are likely a bunch of other quick hitters worth implementing (I’d love to see some listed in the comments), but in the end – as always – the most important thing is just to be smart with your app. No amount of tweaks (big or small) can overcome bad decisions in the overall implementation.