I'm going to move a website to a new server with a different IP address. I have copied all files and data and it's working well. I tested this by editing the hosts file so that I could see the new server while it wasn't public yet.
Now, I'm going to change the A and AAAA records for the website to point to the new server. They both have a TTL of one hour. I believe this means that a client may wait a maximum of one hour to renew the cached DNS records. However, I want to send my visitors directly to the new site. I was thinking of building a small webpage on the old server like this:
The site has been moved and is currently unavailable to your computer.
<a href="/">Try again</a> in one hour.
It would be great if I could add some client-side code to tell the client and/or the client browser to flush its DNS cache. Is something like that possible?
Theres no way to flush a clients DNS records. But if your old server will let you, you could use an .htaccess file to rewrite the request to the new server and add a 301 permentantly moved status code.
If you don't have access to the actual web server, then you could use a page like that. Or even put a javascript redirect after 3 seconds to the new server.
But really, I would think it wouldn't hurt to just leave the old files. Update both for the next week or so to make sure the DNS changes for everyone, and then do whatever redirection you want to. It should make the transfer seem a bit more seamless. That is, unless you changed servers to add a new feature of some sorts that you couldn't on the old one.
But generally, its bad form to just tell people to come back in an hour. Maintenance screen are sometimes necessary, but you can definitely damage your traffic and user base by doing it.