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

Add revalidated extension #242

Merged
merged 4 commits into from
Jun 23, 2024
Merged

Conversation

karpetrosyan
Copy link
Owner

@karpetrosyan karpetrosyan commented Jun 23, 2024

Every response will have a revalidated extension that indicates whether the response has been revalidated or not.

Note that a response could have revalidated set to True even when from_cache is set to False. This occurs when the cached entry has been updated and a new entry is downloaded during revalidation.

>>> import hishel
>>> client = hishel.CacheClient()
>>> response = client.get("https://www.example.com/endpoint_that_is_fresh")
>>> response.extensions["revalidated"]
False
>>> response = client.get("https://www.example.com/endpoint_that_is_stale")
>>> response.extensions["revalidated"]
True

@karpetrosyan karpetrosyan added the enhancement New feature or request label Jun 23, 2024
@karpetrosyan karpetrosyan merged commit f824747 into master Jun 23, 2024
6 checks passed
@karpetrosyan karpetrosyan mentioned this pull request Jun 23, 2024
hartym pushed a commit to hartym/hishel that referenced this pull request Jun 24, 2024
* Add revalidated extension

* Changelog

* fix docs

* Fix docs

---------

Co-authored-by: Karen Petrosyan <k.petrosyan@actum.cx>
karpetrosyan pushed a commit that referenced this pull request Jun 28, 2024
* fix: fixes revalidation issue for pool implementation (#239)

* Add `revalidated` extension (#242)

* Add revalidated extension

* Changelog

* fix docs

* Fix docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant