Hi I am using Angular and iframe. I would like to detect if the target website is online or not before load it into the iframe. I am currently using the following code
try {
await this._httpClient.get(url, { observe: 'response' }).toPromise();
} catch (error) {
return error.status === 200;
}
However, it takes more than 20 seconds to check one website when the website it offline, but quite quick when the website is online. Is there faster way to detect if a target website is online or not? Thank you