Skip to content

Instantly share code, notes, and snippets.

@w3guy
Forked from ideadude/cache_test.php
Created January 25, 2018 20:30
Show Gist options
  • Save w3guy/596401fcc37a638ed6040946e23ca311 to your computer and use it in GitHub Desktop.
Save w3guy/596401fcc37a638ed6040946e23ca311 to your computer and use it in GitHub Desktop.
PHP Script to Use for Testing Server Caching
<?php
$now = date('Y-m-d H:i:s', time())
?>
<html><head><title>Cache Test (<?php echo $now;?>)</title></head>
<body>
<h1>Cache Test</h1>
<p><?php echo 'Time right now: <strong>' . $now . '</strong>'; ?>
</p>
<p>If this doesn't refresh on page load, then something is caching this page.</p>
<p>You can try adding ?t=arandomnumberorstring to the end of the URL to break the cache. You'll see the current time.</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment