In my production.rb I’ve set this:
# Enable serving of images, stylesheets, and JavaScripts from an asset server
config.action_controller.asset_host = "http://myassets.com"
And the images, js and stylesheets are loading fine from my CDN (assets server)
but what if someday this asset servers fails? and it returns a 404?
Because in my assets server (CDN) I have configure a pull zone, the content is still available from /assets/...
Is there any fallback or how can I make a fallback so when my assets server fails or return error my application loads assets from /assets/ inside the application?
production.rb
For more info, see AssetTagHelper
Edit
I don’t think this precaution is worth the extra load/added requests to your application. If you were building a large application with failover servers to provide high availability, assets would be yet another thing you’d accommodate for with that redundancy. If you’re hosting your stuff on the cloud through a service like AWS or Rackspace, I think you’re good on availability and you shouldn’t worry about the issue. This approach almost completely negates the benefit of caching assets.