diff options
author | Andrew Dolgov <[email protected]> | 2013-03-30 15:35:16 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-30 15:35:16 +0400 |
commit | 31623bfa99dcd0c0abf0cf554ab1e69a12c02d9e (patch) | |
tree | 89035a8ec8f94843476dbfea15afe51345946bbc | |
parent | 7a01dc776ed6e124eac9db1a288d4aa5ab63b53d (diff) |
if-modified-since: also take last_updated into account
-rw-r--r-- | include/rssfuncs.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 7c668f69f..e2b6f57f8 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -240,6 +240,7 @@ $rss = false; $rss_hash = false; $cache_timestamp = file_exists($cache_filename) ? filemtime($cache_filename) : 0; + $last_updated_timestamp = strtotime($last_updated); if (file_exists($cache_filename) && is_readable($cache_filename) && @@ -262,11 +263,12 @@ if (!$feed_data) { if ($debug_enabled) { - _debug("update_rss_feed: fetching [$fetch_url] (ts: $cache_timestamp)"); + _debug("update_rss_feed: fetching [$fetch_url] (ts: $cache_timestamp/$last_updated_timestamp)"); } $feed_data = fetch_file_contents($fetch_url, false, - $auth_login, $auth_pass, false, $no_cache ? 15 : 45, $cache_timestamp); + $auth_login, $auth_pass, false, $no_cache ? 15 : 45, + max($last_updated_timestamp, $cache_timestamp)); if ($debug_enabled) { _debug("update_rss_feed: fetch done."); |