The docs say that php artisan down --retry=60 will send a Retry-After header along with the 503 response when the app is in maintenance mode.
What it doesn't tell us is that no browsers actually implement the expected retry after the passed time... 😄 It's basically only googlebot that cares about that header.
A practical solution to get the desired user experience in most browsers is to also send a Refresh header containing the timeout in seconds. The Refresh header is unfortunately undocumented but nonetheless it seems to have the desired effect in real world browsers!
I suggest adding a new --refresh option to the artisan down command that sets a separate Refresh header, and document the practical difference between the two options.
Adding this as a new option is probably good to avoid surprising anyone with an unexpected change in behavior in a part of your app you most likely never test before using... 😄
The docs say that
php artisan down --retry=60
will send aRetry-After
header along with the503
response when the app is in maintenance mode.What it doesn't tell us is that no browsers actually implement the expected retry after the passed time... 😄 It's basically only googlebot that cares about that header.
A practical solution to get the desired user experience in most browsers is to also send a
Refresh
header containing the timeout in seconds. TheRefresh
header is unfortunately undocumented but nonetheless it seems to have the desired effect in real world browsers!I suggest adding a new
--refresh
option to the artisandown
command that sets a separateRefresh
header, and document the practical difference between the two options.Adding this as a new option is probably good to avoid surprising anyone with an unexpected change in behavior in a part of your app you most likely never test before using... 😄