18 lines
603 B
PHP
18 lines
603 B
PHP
<?php
|
|
// First visit -> 5s, times match
|
|
// Second visit -> instant, times don't match
|
|
// … T+14 -> instant, times don't match
|
|
// … T+15 (or 16) -> instant, times match (or almost)
|
|
// Nothing for 30s -> 5s, times match
|
|
header('Cache-Control: s-max-age=10, stale-while-revalidate=20');
|
|
sleep(5);
|
|
print('This is a slow test. ' . date('Y-m-d H:i:s'));
|
|
?>
|
|
<ul>
|
|
<li><a href="./slow.php">Slow</a></li>
|
|
<li><a href="./slow-but-fast.php">Slow but fast</a></li>
|
|
</ul>
|
|
<p id="js-date"></p>
|
|
<script type="text/javascript">
|
|
document.getElementById('js-date').innerText = new Date().toISOString();
|
|
</script>
|