Skip to content

Update http cache rules to be more effective - #1870

Merged
glensc merged 6 commits into
Taxel:mainfrom
glensc:http-cache
Jan 16, 2025
Merged

Update http cache rules to be more effective#1870
glensc merged 6 commits into
Taxel:mainfrom
glensc:http-cache

Conversation

@glensc

@glensc glensc commented Mar 17, 2024

Copy link
Copy Markdown
Collaborator

Such overrides actually work now:

  policy:
    "api.trakt.tv/users/me": 12d
    # Trakt search urls, 304 works
    "api.trakt.tv/search/imdb/tt*?type=movie": "7d"
    "api.trakt.tv/search/imdb/tt*?type=show": "7d"
    "api.trakt.tv/search/tmdb/*?type=movie": "7d"
    "api.trakt.tv/search/tmdb/*?type=show": "7d"
    "api.trakt.tv/search/tvdb/*?type=show": "7d"
    "api.trakt.tv/shows/*/seasons?extended=episodes": "2d"

Might even work like offline mode now.

@glensc glensc self-assigned this Mar 17, 2024
@glensc
glensc marked this pull request as draft March 17, 2024 18:01
@glensc

glensc commented Mar 17, 2024

Copy link
Copy Markdown
Collaborator Author

weird errors have appeared with cold cache

WARNING  Connection pool is full, discarding connection: 192-168-x-y.[redacted].plex.direct. Connection pool size: 10  
WARNING  Connection pool is full, discarding connection: 192-168-x-y.[redacted].plex.direct. Connection pool size: 10  
WARNING  Connection pool is full, discarding connection: 192-168-x-y.[redacted].plex.direct. Connection pool size: 10

comes from urllib3

site-packages/pip/_vendor/urllib3/connectionpool.py:                "Connection pool is full, discarding connection: %s. Connection pool size: %s",

EDIT: Asked question about it in requests-cache:

@glensc

glensc commented Nov 8, 2024

Copy link
Copy Markdown
Collaborator Author

Heavy caching may result duplicate marking as watched, i.e plex state is cached, and now another Marking as watched would make duplicate watch.

Should re-fetch item before making actual changes.

@glensc

glensc commented Jan 1, 2025

Copy link
Copy Markdown
Collaborator Author

Stale if error moved a to separate pr:

@glensc
glensc marked this pull request as ready for review January 1, 2025 16:38
@glensc

glensc commented Jan 16, 2025

Copy link
Copy Markdown
Collaborator Author

It seems to be working locally for a while.

Also, as trakt reduced api calls per 5 minute limit, it might become useful to tune caching:

@glensc
glensc merged commit 8053a81 into Taxel:main Jan 16, 2025
@glensc
glensc deleted the http-cache branch January 16, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant