Categories

Using the Coral Cache system for hits from popular sites

While it has never happened, and my site hasn’t been dugg or slashdotted I don’t want to wait to see what happens when it does (I know my server isn’t powerful enough).

One very nice solution to protect against this is to create a ‘blacklist’ of referrals, and if a user comes to the site from one of these then I redirect them off to a cache (the Coral Cache more specifically).

This can work for any linking site, all you need to do is add the main domain into the array list, so for example if you wanted to protect from the BBC linking you would add a new element of the array that contained ‘bbc.co.uk’.

The script performs a simple array lookup checking each domain in the array against the referral to your site and if one of the blacklisted ones is found it redirects to the Coral Cache and stops executing, meaning your server isn’t overly loaded by the slashdotting or digging.