From 7b5dee77719d5da6acde9ba25a0b72f9067442e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 17 Mar 2024 19:59:59 +0200 Subject: [PATCH] Enable stale_if_error, stale_while_revalidate --- plextraktsync/factory/Factory.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plextraktsync/factory/Factory.py b/plextraktsync/factory/Factory.py index 10bd6e8df5..d6d1b2f350 100644 --- a/plextraktsync/factory/Factory.py +++ b/plextraktsync/factory/Factory.py @@ -140,6 +140,10 @@ def session(self): # Plex sends "Cache-Control: no-cache" headers to requests we want to cache cache_control=False, urls_expire_after=self.urls_expire_after, + # https://requests-cache.readthedocs.io/en/stable/user_guide/expiration.html#expiration-and-error-handling + stale_if_error=True, + # https://requests-cache.readthedocs.io/en/stable/user_guide/expiration.html#asynchronous-revalidation + stale_while_revalidate=True, # Plex doesn't Send Vary: X-Plex-Container-Start match_headers=["X-Plex-Container-Start"], )