Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Make browsers actually retry when app is in maintenance mode #2558

Closed
bjuppa opened this issue Mar 31, 2021 · 1 comment
Closed

Make browsers actually retry when app is in maintenance mode #2558

bjuppa opened this issue Mar 31, 2021 · 1 comment

Comments

@bjuppa
Copy link

bjuppa commented Mar 31, 2021

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... 😄

@themsaid
Copy link
Member

Thanks for the suggestion. Submitted a PR for review: laravel/framework#37385

taylorotwell added a commit to laravel/docs that referenced this issue May 21, 2021
* Document refresh option for artisan down command

Release https://github.com/laravel/framework/releases/tag/v8.42.0
included PR laravel/framework#37385 from idea laravel/ideas#2558
that added a `--refresh` option to the `artisan down` command.

* Update configuration.md

Co-authored-by: Taylor Otwell <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants