Score:0

What happens to a user's browser cache when the website's IP address changes?

bg flag

When a website's nameserver is set to point to a new IP address, do the cached html pages and images in the user's browser invalidate and get re-fetched?

Consider this case:

  1. The nameserver's A record's TTL is 5 minutes.

  2. The website's HTML, js and image cache has a TTL of 1 hour.

  3. The nameserver's A record is changed to another IP address.

  4. 10 minutes later a returning user (who has the website cached in his browser) accesses the website.

My understanding is that the user's browser checks its DNS cache, sees that the TTL expired and will re-fetch the website's IP from the internet.

Once all nameservers in the chain honor the TTL, the user's browser receives the website's new IP address.

Would the HTML, JS files and images cached in the user's browser all be refetched from the new IP address, even though their TTL hasn't expired (their TTL is 1 hour)?

I'd like to generally know how the user's browser cache responds to the website's IP address changing.

I've searched this site and across the web and can't get a clear answer for this.

cn flag
Nothing happens. Web sites are accessed by name, not by IP address.
Score:2
ar flag

The cache looks for URL hits. http://example.com/foo.js is still http://example.com/foo.js if the IP of example.com changes.

Many sites do load balancing with DNS, where a single name may have many A records.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.