During the site maintenance period, return 503 and specify the recovery time, how will the crawling party handle it?
Return 503 during maintenance or overload and provide the recovery time, what the crawling party reads is the semantic level of 'temporarily unavailable': it usually retains the included address for a period of time and retries later according to the recovery duration given in the response, instead of considering the address as失效失效. The two things that truly ruin the maintenance period are caching such responses or forcing the maintenance page into 404, 403 and other semantic codes completely different from this.
What does the 503 status code mean
It corresponds to a service being temporarily unable to process requests, not that the content does not exist. Upgrades, traffic spikes, and temporarily unresponsive dependent databases all fall into this category. Semantically, it is different from 'Page deleted' and 'Forbidden access', and using them interchangeably can lead to incorrect long-term decisions by the party reading the response: misjudging it as invalid can cause loss of inclusion, and misjudging it as forbidden access can stop the crawling rhythm.
It is also because it is a temporary state that the specification requires the estimated recovery time to be written in the response header, if possible. The crawling party and monitoring tools arrange the next visit accordingly, and the operations team determines whether the maintenance window has timed out accordingly.
Who should provide the recovery time?
The recovery time is only effective if there is only one source: either the program writes it when returning the maintenance page, or the gateway responsible for maintenance writes it uniformly. When both are written, it is often the last layer read, which is easy to attribute to the wrong cause when troubleshooting.
This is the common division of labor: when the entire station is under maintenance, the gateway layer intercepts and provides a duration; only when a part of the function degrades, the program provides it, at this time, the 'which segment is unavailable' should be written in the response body, rather than giving a temporary code to the entire station in a general way. The duration provided should be slightly longer than the planned window, leaving room for entry retry and queue digestion; writing it too short will make the retry squeeze in the instant of recovery.
Why should this type of response usually not be cached
The document is very clear: the response to temporary issues should not be cached. Otherwise, after the fix is released, visitors and crawlers will still read the old error pages from the cache. This is the most common end-of-maintenance incident - the service has been restored, but the maintenance page is still displayed on the page.
Pay attention to three points when landing. First, make sure the response itself carries the instruction not to cache, so that it does not enter the shared cache. Second, the cache of normal pages should be handled separately according to content, static resources can continue to use addresses with version numbers, and the text pages should be refreshed uniformly after the maintenance window ends. Third, if there is a content distribution layer in front, the recovery action should also be executed at that layer, and simply clearing the cache on the program side is often not enough.
Which three places should be checked along with the collection path
Check the site map. The site uses automatically generated content, and during maintenance, you need to confirm whether it is still outputting old data: If the crawler reads expired entries in the first moment after recovery, the priority for re-crawling will be lowered. Regenerate once after the window ends, which is more stable than manual supplementing.
Then check the redirect table. The site has redirect management, do not add permanent redirects temporarily during maintenance. Once the permanent code is read, the original address weight transfer will be handled on a long-term basis, and the cost of rollback is much higher than maintaining a temporary code. Use temporary semantics for guidance when needed, and withdraw after the window ends.
Ensure consistency of the returned口径: Are the same code and recovery duration given to the home page, list page, and detail page during the maintenance period? When the three types are inconsistent, the crawling party will treat some paths as normally available and retrieve a lot of maintenance page content.
Common questions
Will giving a 503 to the maintenance page affect the existing收录?The temporary semantics itself will not judge the address as invalid. The key is not to let it become a long-term fact cached and not to use a permanent code to replace it.
How long should the recovery time be written for?Further extend the planned window to avoid retries concentrating on the recovery minute; update the description after actual timeout to avoid long-term distortion of the duration in the response.
Is it okay to only hang the static homepage for maintenance?Yes, but make sure all paths go through the same set of judgments, otherwise the interface and detail page may return half of the data, making it harder to investigate.
What should be done after maintenance is over?Regenerate the site map, remove maintenance interception and temporary redirection, check the actual return codes of the three types of entry, and confirm that there are no residual error pages in the cache layer.