I've done some work refactoring the homepage of DoneCal so that it does no logic other than just serving HTML. What it used to do was some basic security checks and stuff so that it says "Hi Peter" and a log out link. Now all of that has been moved to one simple piece of AJAX call.

BEFORE:


# ab -n 1000 -c 10 http://donecal.com/
...
Requests per second:    353.65 [#/sec] (mean)

AFTER:


# ab -n 1000 -c 10 http://donecal.com/
...
Requests per second:    9796.78 [#/sec] (mean)

# ab -n 1000 -c 10 http://donecal.com/auth/logged_in.json
...
Requests per second:    3756.25 [#/sec] (mean)

The reason why loading the index.html can be so fast is because I'm using Nginx directly. In my Nginx config I have to not use the static file if the request isn't a GET request or if it has a query string. I'll need to remove that stuff too and then it means that I can push the index.html file out to my AWS CloudFront CDN using a CNAME.

DoneCal is my first web application that is this Javascript heavy. It raises the bar in terms of optimal HTTP optimization to get the best user experience possible. I love learning this new way of working.

Comments

Your email will never ever be published.

Previous:
EditDistanceMatcher - NodeJS script for doing edit distance 1 matching February 5, 2011 JavaScript
Next:
How I profile my Nginx + proxy pass server February 16, 2011 Python, Web development
Related by category:
ssl_session_cache in Nginx and the ab benchmark December 31, 2010 DoneCal
DoneCal.com international visitors January 21, 2011 DoneCal
DoneCal on MumbaiMirror February 3, 2011 DoneCal
Speed of DoneCal API (over 1,400 request/sec) and HTTPS (less than 100 request/sec) December 27, 2010 DoneCal
Related by keyword:
Be very careful with your add_header in Nginx! You might make your site insecure February 11, 2018 Linux, Web development, Nginx
Fastest way to uniqify a list in Python August 14, 2006 Python
ssl_session_cache in Nginx and the ab benchmark December 31, 2010 Linux, DoneCal
How I simulate a CDN with Nginx May 15, 2019 Python, Nginx