$output = $modx->cacheManager->get(....);
if(empty($output) /.. and some other checks ../ ) {
// get from db & set cache
$output = $modx->getChunk(...);
$modx->cacheManager->set(...);
}
return $output;
But somehow my cache file is totally empty. Even no <?php in it. In this case, the cache file exists but without contents, 0kb. Because the file exists cacheManager::get() is able to include it perfectly, which will make it return 1 (probably for TRUE) and then my $output from above get() method isn't empty.
The 1 appears on the website, and that should not be happening.
I guess the best is to check the filesize of a cache file too!
bertoost created Redmine issue ID 10246
I always do;
$output = $modx->cacheManager->get(....); if(empty($output) /.. and some other checks ../ ) { // get from db & set cache $output = $modx->getChunk(...); $modx->cacheManager->set(...); } return $output;
But somehow my cache file is totally empty. Even no <?php in it. In this case, the cache file exists but without contents, 0kb. Because the file exists cacheManager::get() is able to include it perfectly, which will make it return 1 (probably for TRUE) and then my $output from above get() method isn't empty.
The 1 appears on the website, and that should not be happening.
I guess the best is to check the filesize of a cache file too!