Nov 06 2012

Caution: Heavy Traffic Ahead – How to Prepare your Site for a Visitor Spike

Category: generalGuest Author


A surge in visitor traffic is the dream of every website. Heavy traffic means that your online marketing campaign is paying off, and there are plenty opportunities to turn site traffic into revenue.

But while a surge in visitors is every web marketer’s dream, it can quickly turn into a nightmare if you aren’t prepared. Traffic spikes are like hosting a huge party: you have to make sure that you can accommodate everyone well before the event.

Whether you have an upcoming promotional campaign, or you just want to make your site crash-proof, we’ve compiled some practical tips to ensure that you can accommodate as many visitors as possible.

1. Have a lightweight version of your website

An increasing number of web users now surf the Internet outside the PC, through smartphones and tablets. In fact, the iPad alone accounts for 1% of the world’s web traffic, as well as 2.1% of web traffic in the US. As such, it makes sense to prepare a “lite” version of your site.

Most mobile devices lack full support. Since they can’t display the full version of your site, they waste bandwidth on decorative elements they can’t show, such as Flash and rich JavaScript. A pared-down version redirects mobile users away from your main site, and ensures they get one that is optimized for their device.

To start, remove elements that may not be supported or which eat up data transmission. Animations, large images and auto-playing videos not only take up bandwidth, they lengthen the loading time on mobile devices. Put most of your content in HTML, and use text rather than images for the navigation menu.

Next, you can consider using static HTML pages in place of dynamic ones. A dynamic page places more load on the server, besides loading slower. To further decrease server load, you can also cache the static output of your dynamic pages.

Finally, to save on costs, you can create lite versions of your most visited pages rather than re-doing the whole site. Start with the homepage since it’s the most important part of any site. Then branch out to landing pages and areas that get the most traffic. Mashable has a list of 8 tools to help you create a mobile version of your site.

A lite version reduces not only your server load, but also your mobile visitors’ data consumption.

2. Make use of Content Delivery Networks

A Content Delivery Network or CDN is a system of distributed servers spread across multiple data centers throughout the world.  These networks have two major advantages. First, they let you offload a major chunk of your server load. Second, their global presence means your offloaded content loads faster around the world. Another little-known plus is that CDNs are less vulnerable to DoS attacks, thanks to their distributed infrastructure which can absorb huge amounts of traffic.

To truly leverage a CDN’s capabilities, consider shunting every static file to CDN, such as images, JavaScript and CSS. To do this, look at the source code of your pages and search the URLs. Browser plugins like Firebug make the task easier by displaying every file loaded by a page. The more you can remove from your server, the smaller the load it has to carry when crunch time comes.

3. Use static content whenever possible

While dynamic content is more engaging compared to static, it’s also one of the weakest points when faced with heavy traffic. Pages generated dynamically by languages like PHP, ASP or Perl take up a lot of memory and processing power. When your server has to accommodate thousands of requests at the same time, dynamic code is usually the first to fail.

You can minimize this Achilles heel by reducing the amount of dynamic content on your site. This is most important on your homepage and other landing pages, since these are usually where visitors come in. You can do the same for your product pages if they don’t have to track real-time information like remaining stock.

If you want to quickly convert all that dynamic content to static pages, you can simply copy the HTML source code and paste that as your new page. Another trick is to load a dynamic page to your CDN. The network will cache a static version, which you can then grab and load to your site.

Also, don’t worry about CSS or JavaScript: since these are not processed server-side, they won’t have any more impact on your server load than other static files.

4. Use minimal file formats

If your site has downloadable content, you can trim the data transmission fat by making each file as small as possible.

For instance, instead of hosting PDF files, use a plain text file which is only a fraction of the size. .TXT and .DOC files are typically measured in tens of kilobytes, compared to hundreds of KB for their PDF counterparts. If you prefer to use PDF, generate a file from textual content and leave out the images. Text-based PDFs are not only relatively smaller, they are also easier for search engines to index.

5. Minimize HTTP requests

According to the Yahoo developer team, 80% of end-user response time is spent downloading all the elements that make up a page. These elements include stuff like images, scripts, and style sheets. If you can reduce the number of HTTP requests, you place a lighter load on the server and your pages can load faster.

One way to cut down requests is to combine all your scripts into one file. You can do the same with your CSS files. This greatly minimizes the number of files the browser has to fetch and helps the page load faster.

For images, an image map combines multiple pictures into one contiguous element. For this to work, you have to define the coordinates to ensure proper placement, such as the menu buttons for your navigation bar. While this can be challenging, it can greatly reduce the loading time.

You can also opt to use inline images. These use the data: URL trick to embed the image in the stylesheet. While this practice increases the size of the HTML document, it eliminates HTTP requests. It should be noted that not all browsers support inline images, so you have to test for functionality.

Finally, using CSS sprites can greatly cut back on the number of HTTP requests. You just need to combine the background images for a page into a single image. You can then use the background-image and background-position properties of CSS to display the image as a whole.

6. Upgrade your hosting service

Sharing your web server is a gamble. You are relying on other customers not slowing down your server by consuming a lot of traffic. If you end up sharing a server with another site that drives a lot of traffic, your performance will slow significantly.

To ensure the best functionality for your site and increased speed in load times, you should move away from shared hosting service and find a web host with dedicated servers that will give you the freedom and functionality you need to support high traffic levels. Since you have your own server, you will be able to make sure your data is a lot more secure, have your own IP address, and rely on increased speed and performance.

When you’re expecting a visitor spike this upgrade will pay for itself in sales conversions. The easier your customers can navigate your site, the better experience they’ll have, and the more likely they’ll convert.

7. Load-proof your shopping cart

All the marketing success you enjoy will go to waste if you can’t translate that into sales. And to do that, you have to ensure that your site visitors have a stable checkout process.

This part of your site should load quickly, take up minimal resources, and accommodate multiple orders per second. Some checkout pages stumble during the process by getting corrupted, taking too long to accept orders, or, worse, ceasing to load entirely. A customer who has to fill out dozens of fields – only to be asked to re-do the whole thing – will likely get fed up and take their business elsewhere.

An ideal e-commerce platform is one that uses efficient code, such as compiled C++, and has been proven to handle multiple orders per second. Before settling for one platform, read the reviews of other users and test your own process under heavy load to make sure it doesn’t fail when the orders come pouring in.

8. Use a benchmark tool to test your site

Once you’ve implemented the above measures, put your site to the test.

Google’s Page Speed and Yahoo’s YSlow are two often used benchmarking tools for testing your site’s performance under pressure. This blog helps explain the processes behind each tool, and how you can use them to speed up the loading time of individual pages.

Remember that websites aren’t all about traffic. As your web pages get richer and demand grows, don’t neglect your server struggling behind the scenes. If you are expecting an influx of web traffic, it’s best to prepare in advance so that you can comfortably accommodate everybody. Your site and your visitors deserve no less.

If you enjoyed this post, make sure you subscribe to my RSS feed! You can also follow me on Twitter here.

Tags: , , , ,