Why returning a 503 when the site is upgraded and maintenance page is displayed is more reliable than returning a blank page
When a site upgrade hangs the maintenance page and returns 503, it is more reliable than returning a blank page because it clearly communicates to three types of objects: it tells the browser 'It's not available now, please try again later', it tells the search engine 'This is a temporary situation, don't mark my page as invalid', and it tells the operations team 'There is a specific recovery time to adhere to.'The definition of MDN is exactly this meaning: This status code indicates that the server is not ready to handle the request, common reasons are that the server is under maintenance or overloaded; this response should only be used for temporary conditions, and the Retry-After header should include the expected time of service recovery as much as possible.
What does this status code mean
The key is in the two words 'temporarily'. 503 expresses that the service is currently unavailable, not that the resource does not exist. It is worth clarifying the difference from other return forms
| Return form | semantics | How do search engines usually understand | Applicable scenarios |
|---|---|---|---|
| 503 with recovery time | Temporarily unavailable | Come back later, retain the original index | Scheduled maintenance window |
| 503 Without recovery time | Temporarily unavailable, but duration is unknown | Repeated attempts, crawling frequency exhausted | Emergency failure |
| Blank page with successful status code | Page is normal but content is empty | Judged as low quality or blank page | Should not be used |
| Directly return not found | Resource has been removed | Remove gradually from the index | The page that has truly been taken down |
| Timeout or connection refused | Service unavailable | Failed to record but cannot distinguish the cause | Unable to provide maintenance page |
The second and fourth lines are the most easily misused. 'Return not found directly during the upgrade' will be understood as the content being deleted, and after recovery, it is necessary to re-establish the judgment of the site; 'Return a blank page' will be regarded as the content being empty, both of which may cause long-term effects, and the repair time is far shorter than the impact time.
How much retry time should be given
The document requires Retry-After to include the expected time for service recovery. In practice, it is more stable to take a slightly wider value than expected: it is better to recover in advance and let visitors come back earlier than to give a value shorter than the actual one, which may cause repeated retries.
Three judgment points. First, the time should come from your release plan, not just a default value; writing it short will make the client keep retrying continuously during the maintenance period, increasing the pressure on the recovery moment. Second, the maintenance page itself should provide a human-readable time range, consistent with the machine-readable value in the header, any contradictions will directly damage the credibility. Third, if the recovery is not completed within the expected time, the maintenance page should continue to return the same status code instead of falling back to a blank page.
Why can't the maintenance page be cached
The document has a clear hint about caching: this response is accompanied by a cache-related header that needs special attention, as it indicates a temporary issue, which should not be cached. Otherwise, after the fix, the client may receive outdated error pages.
This is the most common type of maintenance page incident: the site has been restored, but the erroneous page still exists in the shared cache and at the acceleration nodes, users continue to see maintenance notifications, while the source site logs look normal.
There are two layers to handle. When the maintenance page response is given by the application and deployment layer, include a non-persistent declaration; after recovery, actively refresh the cache layer instead of waiting for the object to expire naturally. If only the first layer is done without refreshing, it is still possible to leave existing objects behind; if only refreshed without the declaration, it may still be stored on the cache strategy relaxed link.
Additionally, the maintenance page should not contain a redirect. Converting an unavailable state to a single redirect will make the downstream treat it as a normal page, and also cause the recovery time information to be completely lost.
The upgrade window and the sequence of site map and push notifications.
The maintenance window is not just about 'blocking access to the page', but also includes how to return the state to the crawling party after recovery. It is recommended to arrange in this order.
Before the window starts: make a backup first. The site supports data and static file backup and recovery, which can be rolled back in case of upgrade issues, this step determines whether all subsequent operations are reversible.
During the window: the entire site returns an unavailable state with a recovery time, the access to the site map also falls into this state, do not appear in the combination of 'page unavailable but site map can still be crawled and return the old address list'.
瞬间恢复:首先确认源站正常响应,然后刷新缓存层,接着核对站点地图内容是否为当前状态。站内支持站点地图自动生成,恢复后无需手动重建文件,但需要确认它反映的是当前文档集合。
恢复后:对窗口期间发布或修改的内容进行链接推送,向搜索引擎主动提示新内容,加速重新抓取。主动推送的价值在恢复期间尤其明显——它比等待对方按自己的节奏回访更直接。
If the upgrade changes the address structure at the same time, the redirection needs to be configured before the push. Leaving a large number of old addresses directly to the crawling party for judgment can easily be considered as content disappearance; first set up the redirection, then push the new structure, reversing the order will cause an unnecessary round of explanation.
Several ways that are easy to misuse
The first one is to return a successful status and a prompt text during the maintenance period. This will make the downstream think that the page is normal, and treat the maintenance prompt as content included.
The second one is to fill the maintenance page with business copy and keywords. The maintenance page should be extremely simple, explaining the reason for unavailability and the expected recovery time.
The third option does not have a recovery time and the window is very long. Unavailability for more than tens of minutes without any duration indication will significantly increase retry and customer service pressure.
The fourth option is to only display a maintenance page on the front desk, with the interface and backend entry being accessible as usual. This semi-open state is prone to inconsistencies in data writing and page rendering, and should be unified during upgrades.
Common questions
Do I need to write a reason for the maintenance page?Write one sentence to explain the temporary unavailability and the expected recovery time. Specific fault details do not need to be disclosed.
How long is too long?There is no unified standard, but maintenance that exceeds the planned time should restate the recovery expectation rather than let the same time value keep taking effect.
Can only the maintenance page be displayed to users, while allowing search engines to pass?The source site must be able to render normally when allowed to pass, otherwise, the half-finished state captured is worse than a unified return of unavailability.
How long will it take to return to the normal inclusion rhythm after recovery?It depends on the frequency of site updates and revisit rhythm. Active push can shorten the waiting time, but cannot replace the stability of the site map and the content itself.
Should subscription notifications be stopped during maintenance?It is recommended to suspend automatic sending to avoid links in the notification pointing to unavailable pages, and resending after recovery.