Block Coral Cache / Coral CDN

Deny CoralCache from Indexing Your Site

CoralCache aka Coral CDN gives users access to a sort of ‘cached’ copy of your website, in case your site were to be offline. You can also set up your site to serve images and assets from the CoralCache CDN url – by appending `.nyud.net` to your domain name.

If you don’t like the idea of a copy of your site floating around out there, you’re not alone.

There is a bit of good news about how CoralCDN works, though:

1. It blocks content from being indexed at the cached location. Just try and visit the cached site’s `/robots.txt`
1. It only caches content that has been requested. It won’t crawl your website and create an entire cache of the site. That is, only when people try to browse your site and append the `nyud.net` will the CoralCache server crawl your site and index the requested pages and assets.
1. It does respect `expires` headers sent with the content

Now, how do you block CoralCache from indexing your site?

If you have WordPress add this to the very top of your `wp-config.php` file, right below the opening `< ?php` tag. It works even if you are using `WP SuperCache` in PHP mode: if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'CoralWebPrx') !== false)tested { echo 'No caching allowed for CoralCache / CoralCDN'; echo "

You can test it out with this page: techblog.willshouse.com.nyud.net/2013/05/13/block-coral-cache-coral-cdn

If you try to test this you’ll need to test it on a page of your site that has not recently been requested via the CoralCDN – or wait until the cache times out. It should display the message briefly and then redirect to the corresponding page on your website.

Related Posts:

  • No Related Posts
This entry was posted in Tech Tips and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *