Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-55916

Maintenance mode should serve a http 503 instead of a 200

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Note - To check for response code:
      1. Open your browser's developer tools, click on the Network tab.
      2. Reload the page.
      3. Select the resource that is being loaded (e.g. if you loaded http://[YOUR_MOODLE]/my/, select the entry for my/.
      4. Click on the Headers tab and inspect the Status Code, Status and Retry-After response headers.
      Testing procedure
      1. run php admin/cli/maintenance.php --enable, load any page and confirm it serves a 503
      2. php admin/cli/maintenance.php --disable, confirm 200 again
      3. php admin/cli/maintenance.php --enableold, load a deep link and confirm it serves a 503
      4. php admin/cli/maintenance.php --disable, confirm 200 again
      5. Put a site into maint mode from the gui, load a deep link in incognito mode and confirm it serves a 503
      Show
      Note - To check for response code: Open your browser's developer tools, click on the Network tab. Reload the page. Select the resource that is being loaded (e.g. if you loaded http://[YOUR_MOODLE]/my/ , select the entry for my/ . Click on the Headers tab and inspect the Status Code , Status and Retry-After response headers. Testing procedure run php admin/cli/maintenance.php --enable, load any page and confirm it serves a 503 php admin/cli/maintenance.php --disable, confirm 200 again php admin/cli/maintenance.php --enableold, load a deep link and confirm it serves a 503 php admin/cli/maintenance.php --disable, confirm 200 again Put a site into maint mode from the gui, load a deep link in incognito mode and confirm it serves a 503
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull Master Branch:
      MDL-55916-maintmode-503

      Description

      Plenty of good articles for why this is better eg:

      http://stackoverflow.com/questions/2786595/what-is-the-correct-http-status-code-to-send-when-a-site-is-down-for-maintenance

      This is especially important for big sites with lots of publicly available and indexed pages so that google never crawls these and gets the outage page and indexes it.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16