How to survive a heavy traffic burstWarning: This is only an idea and has not been tested. If you post a very interesting article on a webpage, it might attract a huge spike in traffic. If it is linked to by another popular site, such as Slashdot, it could be well more than you are equipped to handle. Fortunately, there are caching proxies. These will cache a page and new requests will get that copy instead of making another request to your server, thus helping you with the load. Note that this can be undesireable if you have advertising. As an example, I will use Coral cache. To use the coral cache, you append ".nyud.net:8090" to the hostname. So, example.com becomes example.com.nyud.net:8090. You can also specify a port. example.com:12345 becomes example.com.12345.nyud.net:8090. It identifies itself with a user-agent that starts with CoralWebPrx. Note that for other proxies, you might be able to use IP address ranges. Using Apache's rewrite engine, you can tell it to redirect all requests that aren't from the cache to the cache. Here is a sample block from a .htaccess file:RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteRule .* http://example.com.nyud.net:8090%{REQUEST_URI} [R=temp,L] |