Last active
October 29, 2021 00:39
-
-
Save hatzopoulos/38059f2300a8fcb95794 to your computer and use it in GitHub Desktop.
PHP Example, 503 Header + Retry After
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ob_start(); | |
// 503 Header | |
header('HTTP/1.1 503 Service Temporarily Unavailable', true, 503); | |
// Retry-After header. Two examples of its use are: | |
// 1. Retry-After: 120 | |
header('Retry-After: '.(1 * 60 * 60)); | |
// 2. Retry-After: Fri, 31 Dec 1999 23:59:59 GMT | |
header('Retry-After: '.gmdate('D, d M Y H:i:s', strtotime('+1 hour')).' GMT'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment