diff --git a/src/web/utils.py b/src/web/utils.py index 5814da00a2..5831d86cb4 100644 --- a/src/web/utils.py +++ b/src/web/utils.py @@ -230,12 +230,10 @@ def calc_next_check_as_per_server_side_cache(self) -> Optional[datetime]: # defer next check as per Cloudflare cache # https://developers.cloudflare.com/cache/concepts/cache-responses/ # https://developers.cloudflare.com/cache/how-to/edge-browser-cache-ttl/ - if ( - self.headers.get('cf-cache-status') in {'HIT', 'MISS', 'EXPIRED', 'REVALIDATED'} - and - wr.expires > now - ): - return wr.expires + if self.headers.get('cf-cache-status') in {'HIT', 'MISS', 'EXPIRED', 'REVALIDATED'}: + expires = wr.expires + if expires and expires > now: + return expires # defer next check as per RSSHub TTL (or Cache-Control max-age) # only apply when TTL > 5min,