You are here

Performance Tip: Offload The Heavy Processing Of Comments

Categories: 

One of the heavier sides of blogging platforms is in comment management. Just sorting and rendering the comments can be heavy enough, but when you add in the extra overhead of services and systems to combat spam, you end up with a lot of your server power going to enabling your visitors to give feedback.

Some people try to overcome this by installing extra plugins or modules for their CMS that generate static versions of the pages, preventing the high impact of having their CMS fire up to generate every page view. I'm talking about such systems as wp-supercache for Wordpress and Boost for Drupal. Both of these system are awesome and provide a very significant performance boost, but they also have some problems.

Say you are running a site that allows anonymous commenting and suddenly you get a post that generates a big hit on sites like Digg or Slashdot. Now every time someone posts a comment that page has to be refreshed inside of your CMS, causing it to fire up. You also have other pages, such as your front page and archive pages that also need refreshed.

If you're running Wordpress with wp-supercache then you have another problem. Once someone comments their user information is stored in a cookie. On every following page view the server sees that cookie being sent and bypasses your cache. If it wasn't for that then the user information box on your comment form would always be populated with the information from the last commenter after a page refresh.

(NOTE: Drupal doesn't suffer this problem since all the user information fields are populated on the client's computer via Javascript.)

So what's a great way to overcome this huge performance bottleneck? Offload your comments to a 3rd party system like Disqus.

Disqus gives you a feature rich commenting system on your site without the performance hit. Instead the code is loaded from the client's computer via javascript. It offers the added social networking features of signing in with Facebook or Twitter and can even handle your trackbacks. On top of that it is highly customizable. You can even style it to fit your current theme.

On the moderation side, Disqus rocks. You can set up users as moderators, spam is seldom an issue and you can even moderate comments via email. I've been using the system on IntoxiNation for over a year and never had a problem with it. I'm also now using it right here on HollyIT. Now when someone posts a comment, Boost doesn't need to regenerate the page. As matter of fact my pages never need refreshed unless I post something new, edit a post or make changes to the site. I even have a recent comment widget that appears on all pages and updates automatically without the need for my CMS to generate new pages. In other words I am running a site that is mostly static HTML with most of the features of a dynamic site and without the overhead.

So how do you go about getting Disqus? For Wordpress and Drupal it's very simple. First head over to the Disqus site and register an account. Next you want to go through their wizard and fill in the appropriate information. Once all that is done you will be taken to a final page where you can download the Wordpress plugin or Drupal module, as well as plugins for numerous other systems. The plugins even give you the option of importing your existing comments into Disqus and if you ever decide to leave you can export them back into your site. Nothing could be simpler and it can save you a ton in hosting costs over the years.

But what about money? Don't worry about it. Disqus is a free system and very reliable. I can't recommend them enough. So what you aiting for? Go ahead and give them a try. I think you will be very happy with the performance boost you see in your site.