on Jun 7th, 2007Rules for high performance websites
My recent interest in building scalable applications has led me to learn a lot of simple yet effective programming and deployment techniques, to scale and deliver web apps with ease. Its not rocket science to build for scalability but it certainly gets challenging when your app really scales you come across problems about your environment, unknown to you. Take for example our servers, since we host on shared environments our servers flush their memory contents every 24 hours or so. This is done to keep the discarded objects and dangling pointers from filling up the memory. But when did I figure this out, post deployment - what followed next was an analysis of all the problems that we were to face because of this new found wisdom. Truly, most of our so called cool functionality came crashing down like a hailstorm ( truth behind why Instant Messaging never got off the ground on Samparkh ). We did try to tailor the code and make it work, and it did too, but a problem like this requires a visit back to the drawing board. The next time we know better than to code with assumptions ; most of us aren’t lucky enough to know all about our deployment environments, so we make do with assumptions.
That was a lesson, no harm done, no money lost. But there are some applications that have to be delivered to be robust , scalable and always available. I found this article which highlights some rules for high performance website. I suggest you visit this site and read about these rules, its worth it .
- Rule 1 - Make Fewer HTTP Requests
- Rule 2 - Use a Content Delivery Network
- Rule 3 - Add an Expires Header
- Rule 4 - Gzip Components
- Rule 5 - Put CSS at the Top
- Rule 6 - Move Scripts to the Bottom
- Rule 7 - Avoid CSS Expressions
- Rule 8 - Make JavaScript and CSS External
- Rule 9 - Reduce DNS Lookups
- Rule 10 - Minify JavaScript
- Rule 11 - Avoid Redirects
- Rule 12 - Remove Duplicate Scripts
- Rule 13 - Turn Off ETags
- Rule 14 - Make AJAX Cacheable and Small
This is neat. We’ll use this for our apps too!
One more I can think of: Program in a functional manner. Don’t have side-effects, ‘coz that is the biggest impediment to parallelism.