Created
February 1, 2013 18:52
-
-
Save bigdawggi/4693237 to your computer and use it in GitHub Desktop.
Quick and dirty cache expiration testing. I placed in functions.php just for a quick place to put it. Refresh the page, and it should change every 10 seconds.
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 | |
if (isset($_GET['matt'])) { | |
$cur_time = time(); | |
$cache = wp_cache_get('matt-time', 'matt'); | |
if ($cache !== false) { | |
echo '<pre>Found'.print_r($cache, 1).'</pre>'; | |
} | |
else { | |
wp_cache_set('matt-time', $cur_time, 'matt', 10); | |
$cache = wp_cache_get('matt-time', 'matt'); | |
echo '<pre>Setting'.print_r($cache, 1).'</pre>'; | |
} | |
die(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment