Fallback to local images when Cloud Files breaks? I'm using the Cloud Files module which uses the Rackspace Cloud Files PHP API to store all uploaded files on Rackspace Cloud Files (a CDN). It all works very well.

However, today, Rackspace itself had an outage related to their API and it caused my entire site to break. I absolutely can't have this happen when my site is finally live. Is there any way to keep the files locally as well as in Cloud Files so that if there is a problem I can flip a setting in the admin pages and it'll start using the local files so that the site continues working while Rackspace works on the problem?
In javascript, you can listen to the image's onerror event listener.

set the source as normal. in onerror, set this.src to your local image path:

&lt;img src="//somecdn.com/cat.jpg" onerror="this.src='/localpath/cat.jpg';" /&gt;​


you could use jquery to loop over all images on the page and add the onerror event listener