'Provide fallback URL or domain to browser
Is there a server-side mechanism to provide a fallback URL or domain for the client to try if the initial request doesn't provide an OK response?
I'm working on an image CDN-type project and was wondering if there's a standardized way I can give the Browser or Client a backup domain or URL to try if the normal resource fails, since I don't have control of the client.
For Example:
The first successful response to https://coolwebsiteone.com/apple.jpg
provides a header that goes through an Amazon CDN
X-Fallback-Domain: https://coolwebsitetwo.com
Later on, after the resource expires, the Client makes a request that fails because the Amazon CDN is down or some other reason.
So then the client tries the request again with the Fallback Domain that uses Google's CDN or some alternative pipeline.
https://coolwebsitetwo.com/apple.jpg
The thinking is: As long as a version of the original resource is available to * A * CDN it is more likely to be available.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|