I have a Pi Zero that is always running a Python script connected to a MySQL database on a website I am hosting. Every 5 seconds, the Pi updates a time field in the database, and there is a cron job that runs on the website every minute which checks that the timestamp has been updated within the past 60 seconds. If not, it sends an email to notify me that the Pi is down, and once the timestamp in the database has been updated, it notifies me that the Pi is up again.
I have noticed when my home Internet goes down for a short period of time like a few minutes or less, it often takes the Pi approximately 15 minutes to reconnect. Other devices on my network reconnect as soon as the Internet is up again. I am using the official Raspberry Pi USB Wi-Fi dongle with my Zero, and have observed the same behavior on a Pi 2.
I don't understand why there is this delay for the Internet on the Pi to reconnect. Has anyone else experienced this and figured out how to fix it? Thank you.