I’m not a blogger. I’m not a good writer and I don’t have any interesting stories or insights to share. But I always wanted to have a blog. Maybe just because everyone has one. So, even though I didn’t write much, I have tried numerous blogging engines over the years. I even wrote my own (which was used by me and my friends partly like those kids today are using facebook: to post funny pictures and party invitations). I also tried wordpress and several hosted solutions such as posterous and tumblr. But it never felt right.
This time it feels better: I’m using Jekyll to build static HTML pages out of HTML templates and markdown formatted text. I can use vim to edit posts and quickly update the whole page. This fits my simple needs perfectly, unlike those huge piles of php scripts. And I have full control over the HTML code that gets generated, so if you look into the source of this page, you’ll see nicely indented code (except for whatever the markdown parser generates).
This whole system feels so efficient and lean that I started thinking about how to further improve load times of the page. After all, there’s nothing to do on the server side but accepting requests and streaming the contents of static files to the clients. The Apache server running on my virtual server does this blazingly fast, especially (which I find a bit confusing) when turning Keepalive off in the config, but there is still something that can be improved: The page won’t be displayed by the browser before all css and javascript files have been fetched. This means a few extra requests and kb before the user sees anything on the screen. To prevent this, I’m using the modernizr load plugin, which loads the scripts asynchronously in the background. Of course, you can not use deferred loading for scripts that must run before the page has been fully loaded, but in my case it doesn’t matter if jQuery, the fancybox plugin and the google analytics script are executed a few ms after the user sees the page.
This makes the page load really fast:
Additionally, I have enabled sending cache expiry headers in .htaccess, so that each subsequent request will only need to fetch the pure HTML (which will be sent compressed for clients that support it by the way). This means that all further links the user visits will be rendered within under 100ms - given a fast enough client connection of course.
I hope you noticed this when visiting this article…