diff options
author | Andrew Dolgov <[email protected]> | 2013-03-30 15:42:27 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-30 15:42:27 +0400 |
commit | 17e74b21cf7dcb6d57c44b3cbf5e4c330f5f2c17 (patch) | |
tree | 4ee9279a8376fda13baa281a63d93a92f4361346 /include | |
parent | 31623bfa99dcd0c0abf0cf554ab1e69a12c02d9e (diff) |
update_rss_feed: bailout if cache is considered valid, but older than last_updated
Diffstat (limited to 'include')
-rw-r--r-- | include/rssfuncs.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php index e2b6f57f8..49d9e6009 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -251,11 +251,18 @@ _debug("update_rss_feed: using local cache."); } - @$rss_data = file_get_contents($cache_filename); + if ($cache_timestamp > $last_updated_timestamp) { + @$rss_data = file_get_contents($cache_filename); - if ($rss_data) { - $rss_hash = sha1($rss_data); - @$rss = unserialize($rss_data); + if ($rss_data) { + $rss_hash = sha1($rss_data); + @$rss = unserialize($rss_data); + } + } else { + if ($debug_enabled) { + _debug("update_rss_feed: local cache valid and older than last_updated, nothing to do."); + } + return; } } |