Skip to content

Instantly share code, notes, and snippets.

@TheLastCicada
Created January 16, 2013 20:22
Show Gist options
  • Save TheLastCicada/4550535 to your computer and use it in GitHub Desktop.
Save TheLastCicada/4550535 to your computer and use it in GitHub Desktop.
old advanced-cache.php
// Add some debug info just before </head>
if ( $batcache->debug ) {
if ( false !== $tag_position = strpos($batcache->cache['output'], '</head>') ) {
$tag = "<!--\n\tgenerated " . (time() - $batcache->cache['time']) . " seconds ago\n\tgenerated in " . $batcache->cache['timer'] . " seconds\n\tserved from batcache in " . $batcache->timer_stop(false, 3) . " seconds\n\texpires in " . ($batcache->max_age - time() + $batcache->cache['time']) . " seconds\n-->\n";
$batcache->cache['output'] = substr($batcache->cache['output'], 0, $tag_position) . $tag . substr($batcache->cache['output'], $tag_position);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment