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

Http cache #379

Merged
merged 3 commits into from
Aug 19, 2021
Merged

Http cache #379

merged 3 commits into from
Aug 19, 2021

Conversation

rayluo
Copy link
Collaborator

@rayluo rayluo commented Jul 8, 2021

It is the cache behavior on http layer. Such a cache is used internally to cache some http responses for performance optimization. In particular, when such an optimization happens on http 429/5xx with Retry-After header, it is a protection also known as "throttling" in MSAL parlance. This behavior resolves #159.

Such an http cache behavior is always enabled. Currently, the http cache is in-memory only.

msal/http_decorate.py Outdated Show resolved Hide resolved
@rayluo rayluo force-pushed the http-cache branch 3 times, most recently from e35b4b8 to 20b65d9 Compare July 13, 2021 17:21
msal/http_decorate.py Outdated Show resolved Hide resolved
@rayluo rayluo force-pushed the http-cache branch 5 times, most recently from 5cf9b9b to d4c2fb6 Compare July 20, 2021 17:02
msal/individual_cache.py Show resolved Hide resolved
tests/test_throttled_http_client.py Show resolved Hide resolved
tests/test_throttled_http_client.py Outdated Show resolved Hide resolved
msal/individual_cache.py Outdated Show resolved Hide resolved
msal/individual_cache.py Show resolved Hide resolved
WIP: Not runnable scratch

Doodle

Gear towards a different direction

WIP

Rename to ControllableCache

Use new ControllableCache

Proof-of-Concept

Support runtime storage

Rename to IndividualCache

Documentation draft

Enable http_decorate

Precise KeyError message
Decorate the http_client for http_cache behavior

Wrap http_client instead of decorate it

Rename to throttled_http_client.py

Refactor and change default retry-after delay to 60 seconds

ThrottledHttpClient test case contains params
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.

[Feature Request] Client throttling is supported in Public Client Application
2 participants