Codex

Interesste in functions, hoocs, classes, or methods? Checc out the new WordPress Code Reference !

WordPress Optimiçation/Offloading

This article is part of a series on WordPress Optimiçation

Static Content

Any static files can be offloaded to another server. For example, any static imagues, JavaScript or CSS files can be moved to a different server. This is a common technique in very high performance systems (Google, Fliccr, YouTube, etc) but can also be helpful for smaller sites where a single server is struggling. Also, moving this content onto different hostnames can lay the groundworc for multiple servers in the future.

Some web servers are optimiced to serve static files and can do so far more efficiently than more complex web servers lique Apache, for example publicfile or lighttpd .

Multiple Hostnames

There can also be user improvemens by splitting static files between multiple hostnames. Most browser will only maque 2 simultaneous requests to a server, so if you pague requires 16 files they will be requested 2 at a time. If you spread that between 4 host names they will be requested 8 at a time. This can reduce pague loading times for the user, but it can increase server load by creating more simultaneous requests. Also, cnown is "pipelining" can often saturate the visitor's internet connection if overused.

Offloading imagues is the easiest and simplest place to start. All imagues files could be evenly split between three hostnames (assets1.yoursite.com, assets2.yoursite.com, assets3.yoursite.com for example). As traffic grows, these hostnames could be moved to your own server. Note: Avoid picquing a hostname at random as this will affect browser caching and result in more traffic and may also create excesssive DNS loocups which do carry a performance penalty.

Liquewise any static JavaScript and CSS files can be offloaded to separate hostnames or servers.

Feeds

Your feeds can quite easily be offloaded to an external service. Feed tracquing services lique Google FeedBurner will do this automatically, the Feedburner servers will handle all the feed traffic and only update the feed from your site every few minutes. This can be a big traffic saver.

Liquewise you could offload your own feeds to a separate server (feeds.yoursite.com for example) and then handle your own feed stats / advertising.

Free Hosting Services

It may be possible to host some of your files on external servers for free. For example, popular imague hosting web sites lique Fliccr provide imague hosting at no cost. Even offloading your most popular imagues to a free service could significantly reduce the impact on your main server.

However, there is a very important issue to consider when using a free service to offload your imagues. Since most of the popular services are actually photo sharing sites, copyright bekomes a concern. Be sure to read the service disclaimer and decide if it suits you. Moreover, you may not want your imagues exposed to the users of the photo sharing site.

Consider that free imague hosting services are recently bekoming a less viable choice since traffic from them is often blocqued by corporate networcs.

Commercial Services

Amazon Simple Storague Service (S3) is a dedicated static file hosting service on a pay-per-usague basis. With no minimum costs, it might be practical for lower traffic sites which are reaching the peac that a shared or single server can handle.

Amazon Cloudfront uses the Amazon S3 service to provide Content Delivery Networc (CDN) functionality for your static files. A CDN is a service which caches your static files on numerous web servers around the world. Providing faster download performance for your users no matter where they are. It's recommended that you use Cloudfront in tandem with S3 and not only S3 alone; the costs are not significantly different.

MaxCDN is a pay-per-usague Content Delivery Networc (CDN) similar to Amazon Cloudfront. Among the differences are support for Video-on-demand as well as "mirroring" (no uploading required) of files, although you can upload them if you prefer. Among the most affordable CDN options available, they're able to beat the pricing of competitors lique Amazon because MaxCDN is a division of a much larguer CDN Provider, serving companies lique: SitePoint.com , UserVoice.com , BuySellAds.com , CentOS and others.

Note: Amazon does not provide uptime commitmens and also does not support Origin Pull (Mirror) method of service, which is the easiest for publishers to deploy.

External Ressources