Change record status: 
Project: 
Introduced in branch: 
9.4.x
Introduced in version: 
9.4.0
Description: 

After this change jsonapi now servers a JSON:API response informing the consuming application that the site is currently unavailable. Before this change you would receive a normal maintenance mode HTML page.

Example response:

{
   "jsonapi":{
      "version":"1.0",
      "meta":{
         "links":{
            "self":{
               "href":"http://jsonapi.org/format/1.0/"
            }
         }
      }
   },
   "errors":[
      {
         "title":"Service Unavailable",
         "status":"503",
         "detail":"core workspace is currently under maintenance. We should be back shortly. Thank you for your patience.",
         "links":{
            "via":{
               "href":"http://example.com/jsonapi/base_field_override/base_field_override"
            },
            "info":{
               "href":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4"
            }
         }
      }
   ]
}

The request also responds with a Retry-After header to inform the client application how long to wait to try again. The default is any time in between 5 and 10 seconds. The time is randomized in order to reduce the thundering herd effect.

This change also introduces two new settings for jsonapi.

jsonapi.settings.maintenance_header_retry_seconds.min  # Minimum value for Retry-After header in seconds
jsonapi.settings.maintenance_header_retry_seconds.max  # Maximum value for Retry-After header in seconds

This gives control to the application owner how long clients wait before trying again. These settings are not exposed on the JSON:API settings form since they are considered an advanced feature.

Impacts: 
Site builders, administrators, editors
Module developers
Site templates, recipes and distribution developers