OLD | NEW |
---|---|
(Empty) | |
1 <?php | |
nhiroki
2015/08/06 09:57:28
Can you rename this file to "update-error-worker.p
jungkees
2015/08/06 10:53:12
Sure, I'll change it.
| |
2 if(!isset($_COOKIE['mode'])) | |
3 $mode = 'plain'; // For the first fetch, set the mode to plain. | |
4 else | |
5 $mode = 'error'; // For the second fetch, set the mode to error. | |
6 | |
7 // Plain mode sets the normal mimetype. | |
8 if ($mode == 'plain') { | |
9 echo '// Plain mode.'; | |
10 header("Cache-Control: no-cache, must-revalidate"); | |
11 header("Pragma: no-cache"); | |
nhiroki
2015/08/06 09:57:28
Let me confirm my understanding... in the latest s
jungkees
2015/08/06 10:53:12
Yes, that's my understanding and intention. I noti
jungkees
2015/08/07 05:18:30
I've double-checked this with jakearchibald@. It's
| |
12 header('Content-Type:application/javascript'); | |
13 setcookie('mode', 'error'); // Set cookie for 2nd fetch to work in error mode. | |
14 } | |
15 // Error mode sets a disallowed mimetype. | |
16 else if ($mode == 'error') { | |
17 echo '// Error mode.'; | |
18 header("Cache-Control: no-cache, must-revalidate"); | |
19 header("Pragma: no-cache"); | |
20 header('Content-Type:text/html'); | |
21 unset($_COOKIE['mode']); | |
22 setcookie('mode', '', time() - 3600); // Delete cookie at the end of the test. | |
23 } | |
24 echo '// ' . microtime(); | |
25 ?> | |
OLD | NEW |