Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Enable stale_if_error, stale_while_revalidate #2132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plextraktsync/factory/Factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)
Expand Down
Loading