Some people report a problem about "The pages do not match! Timestamps differ or were not found!" with Cache Tester. I also had it but found one of the root causes, which seems to be a bug.
The cache for the front page are always re-generated when certain WordPress settings are used. Therefore, the timestamps always differ.
* VERSION
WordPress 3.2.1
WP Super Cache 0.9.9.9
* SETTINGS
Settings > General > WordPress address (URL): http://rewse.jp/blog
Settings > Permalinks > Custom Structure: /p/%post_id%
WP Super Cache > Advanced > Caching: Use PHP to serve cache files.
* ANALYSIS
wp-cache.php:
if ( substr( get_option( 'permalink_structure' ), -1 ) == '/' ) {
wp_cache_replace_line('^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 1;", $wp_cache_config_file);
} else {
wp_cache_replace_line('^ *\$wp_cache_slash_check', "\$wp_cache_slash_check = 0;", $wp_cache_config_file);
}
$wp_cache_slash_check is set to 0 when get_option('permalink_structure') is "/p/%post_id%".
wp-cache-phase1.php:
if (
(
$wp_cache_request_uri == '/' ||
( $wp_cache_slash_check && substr( $wp_cache_request_uri, -1 ) == '/' ) ||
( $wp_cache_slash_check == 0 && substr( $wp_cache_request_uri, -1 ) != '/' )
) &&
( wp_cache_get_cookies_values() == '' && empty( $_GET ) && $serving_supercache ) )
$wp_cache_request_uri is "/blog/" when http://rewse.jp/blog/ is accessed. By the above, $wp_cache_slash_check is 0. These 2 values mean this if statement is always false -- always goes to "No wp-cache file exists. Must generate a new one." -- when http://rewse.jp/blog/ is accessed.
* WORKAROUND
I confirmed to fix it by the below dirty huck.
if (
(
$wp_cache_request_uri == '/blog/' ||
* DEBUG LOGS
Before workaround:
01:04:11 /blog/ supercache dir: /var/lib/wordpress/rsrc/cache/supercache/rewse.jp/blog/
01:04:11 /blog/ No wp-cache file exists. Must generate a new one.
01:04:12 /blog/ In WP Cache Phase 2
01:04:12 /blog/ Setting up WordPress actions
01:04:12 /blog/ Created output buffer
01:04:13 /blog/ Output buffer callback
01:04:13 /blog/ Anonymous user detected. Only creating Supercache file.
01:04:13 /blog/ Gzipping buffer.
01:04:13 /blog/ Writing non-gzipped buffer to supercache file.
01:04:13 /blog/ Writing gzipped buffer to supercache file.
01:04:13 /blog/ Renamed temp supercache file to /var/lib/wordpress/rsrc/cache/supercache/rewse.jp/blog/index.html
01:04:13 /blog/ Renamed temp supercache gz file to /var/lib/wordpress/rsrc/cache/supercache/rewse.jp/blog/index.html.gz
01:04:13 /blog/ Writing gzip content headers. Sending buffer to browser
01:04:13 /blog/ wp_cache_shutdown_callback: collecting meta data.
01:04:39 /blog/ supercache dir: /var/lib/wordpress/rsrc/cache/supercache/rewse.jp/blog/
01:04:39 /blog/ No wp-cache file exists. Must generate a new one.
01:04:39 /blog/ In WP Cache Phase 2
01:04:39 /blog/ Setting up WordPress actions
01:04:39 /blog/ Created output buffer
01:04:40 /blog/ Output buffer callback
01:04:40 /blog/ Anonymous user detected. Only creating Supercache file.
01:04:40 /blog/ Gzipping buffer.
01:04:40 /blog/ Writing non-gzipped buffer to supercache file.
01:04:40 /blog/ Writing gzipped buffer to supercache file.
01:04:40 /blog/ Renamed temp supercache file to /var/lib/wordpress/rsrc/cache/supercache/rewse.jp/blog/index.html
01:04:40 /blog/ Renamed temp supercache gz file to /var/lib/wordpress/rsrc/cache/supercache/rewse.jp/blog/index.html.gz
01:04:40 /blog/ Writing gzip content headers. Sending buffer to browser
01:04:40 /blog/ wp_cache_shutdown_callback: collecting meta data.
After workaround:
01:08:34 /blog/ supercache dir: /var/lib/wordpress/rsrc/cache/supercache/rewse.jp/blog/
01:08:34 /blog/ Served page from supercache file using PHP.
01:08:48 /blog/ supercache dir: /var/lib/wordpress/rsrc/cache/supercache/rewse.jp/blog/
01:08:48 /blog/ Served page from supercache file using PHP.
Thanks,
Tats