May 27, 2008
Ever since the relaunch of Photub in late 2006, I've been a bit hesitant to allow comments for particular posts, despite the fact that my homebrew blogging solution supports them, and they would be valuable.
The reasons for this aren't what you'd expect. It's not just "don't want to get spammed" or anything like that—that can be solved pretty easily. The biggest problem is that, since I use shared hosting and am not using PHP as the language to implement Photub, the blog runs a bit differently than it would if I were using WordPress or some other solution.
Photub uses FastCGI, which basically means that the blog has to sit there waiting for requests whenever someone requests a page, unlike a solution in PHP where the blog would just "startup" when needed. When the relaunch happened, my host kept killing off the process that was waiting for requests, presumably because it was doing lots of work when a request came in. What I ended up doing was building caching into the site, so that each page gets rendered (when requested) once ever 5 minutes.
This works out wonderfully, especially since database servers on shared hosting tend to be a bit slow. The readers get faster response times, everyone on the shared hosting server is happy, and Photub doesn't get killed off and leave you with 500 Internal Error pages.
That is, it all works well except when you try to add comments. See, comments happen between the 5 minute refresh mark, and a discussion can't happen at 5 minute intervals. Discussions need the ability to be real time or they aren't very effective. I could have made an exception and on pages with comments not done caching, but it was easier to just leave comments out of the picture.
Disqus to the rescue. Disqus is a blog comments solution that is hosted off site (the only thing I don't like about it actually), but it's loaded up via JavaScript instead. What this means, is that caching doesn't matter on my end, everything gets loaded dynamically when you request the page! It's actually a great concept and is executed very well. Plus, they deal with spam, support OpenID, and lots of options for following replies. They do a good job with it, so why not use it? Anyway, not every post will enable comments, but there will definitely be some now that I can enable a real time discussion system. (Comments are enabled for this post)