comparison myrss/index.php @ 20:469b1e6dd364

myrss/index.php: check for non-empty cache file
author paulo@thepaulopc
date Mon, 13 Dec 2010 22:55:24 -0800
parents b1038ce571d3
children f93693980ead
comparison
equal deleted inserted replaced
0:485e0e0fe58c 1:c1030f29ac7c
3 3
4 $cache_fn = "__cache__.html"; 4 $cache_fn = "__cache__.html";
5 $cache_life = "1200"; 5 $cache_life = "1200";
6 6
7 $cache_mtime = "0"; 7 $cache_mtime = "0";
8 if (file_exists($cache_fn)) 8 if (file_exists($cache_fn) && filesize($cache_fn) > 0)
9 $cache_mtime = filemtime($cache_fn); 9 $cache_mtime = filemtime($cache_fn);
10 10
11 $newbody = ''; 11 $newbody = '';
12 12
13 if ((time() - $cache_mtime >= $cache_life)) { 13 if ((time() - $cache_mtime >= $cache_life)) {