简体   繁体   中英

How to clear DNS cache from Javascript in Edge

I am writing a web application that runs in a private network using Microsoft Edge as the browser. The web application is used to service customers.

The web application will be split across two data centres. An F5 Global Traffic Manager (GTM) acts as a glorified DNS, it's job is to allocate an IP for either data centre (red arrow browser to GTM). It will allocate an IP address in a round-robin way so long as it knows the F5 LTMs (red arrows GTM to LTM) are responding as available. The IP address it allocates will have a Time To Live (TTL). There is no way to implement session affinity in the GTM. In each data centre, an F5 Local Traffic Manager (LTM) will balance load across the web application nodes. The F5 LTM will use the jsession cookie to implement session affinity.

在此处输入图像描述

My problem is if the IP address allocated from the HGTM expires (15 minute TTL) mid customer session the browser can & should query the GTM again for the IP address, the GTM can easily allocate out an IP for the alternative data centre breaking session affinity as LTMs in each are only aware of application nodes in the same data centre.

Solutions I have considered: Can I use Javascript to force the browser to query the GTM at the start of the customer session, ensuring that as long as the customer session finishes in 15 minutes there will be no chance of a data centre switch mid-session.

Could I use Javascript to stop the browser doing a DNS look-up inside a customer session & just do the look-up in between customer sessions?

I cannot find a way of using Javascript to implement either solution.

I have other infrastructure options. Nothing is perfect. I'm trying to understand if either of these options is technically feasible for an options paper.

I try to search for a possible solution for clearing the DNS cache of Edge browser using Javascript but did not get any helpful information about it.

It looks like it is not possible to achieve this requirement using Javascript.

As a workaround, If you manually want to clear the DNS cache then you can type edge://net-internals/#dns in the address bar and press the Enter key. Then you can click the Clear host cache button in Edge Chromium browser.

If you are using Edge legacy browser then you can launch Run window and paste ipconfig /flushdns there and press the Enter key.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM