-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
X-FastAPI-Cache header not available in fastapi-cache2 v0.2.1 #281
Comments
Hi: It looks like this is still the case, that Pypi doesn't have the May 17 version, which includes updates here. Is there a way to schedule a deployment please? Thanks much! |
Is still an issue as of Jan 2024. I hope @long2ice can help with this |
@mrisher thanks for the response. In the meantime, can you point me to any other way to know, if a request was a cache hit or miss? I need it in my logging middleware, so that I don't log cached responses multiple times as it produces high load. Thanks |
In my experiments, I get something like:
```
x-cache: MISS
x-cache-hits: 0
```
Try
```curl -i -X 'GET' \
'https://<your server>' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>'
```
…On Tue, Jan 16, 2024 at 11:44 AM Arsenii Velichko ***@***.***> wrote:
@mrisher <https://github.com/mrisher> thanks for the response. In the
meantime, can you point me to any other way to know, if a request was a
cache hit or miss? I need it in my logging middleware, so that I don't log
cached responses multiple times as it produces high load. Thanks
—
Reply to this email directly, view it on GitHub
<#281 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABVHNS5ORLT664XU56YCKTYOZKXFAVCNFSM6AAAAAA3Z3BYV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJTGQ4TAOJZGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@mrisher I'm not sure, how you get these headers to appear in the response. For me, these are the only headers that I get in my responses:
|
I don't know :(
My solution to the error I was getting is, I made a fork (I think from this
commit <#328>) and then am
installing it locally using a PIP Requirements.txt pinned to my local repo.
So maybe that fork uses a slightly newer version than what was in Pypi? I
can't remember how to confirm the branch commit... do you know how?
…On Tue, Jan 16, 2024 at 12:00 PM Arsenii Velichko ***@***.***> wrote:
@mrisher <https://github.com/mrisher> I'm not sure, how you get these
headers to appear in the response. For me, these are the only headers that
I get in my responses:
cache-control: max-age=30
content-length: 784
content-type: application/json
date: Tue,16 Jan 2024 10:58:22 GMT
etag: W/-6181376353854741601
server: uvicorn
—
Reply to this email directly, view it on GitHub
<#281 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABVHNVXGGHTUZJOF2NP4BLYOZMVRAVCNFSM6AAAAAA3Z3BYV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJTGUYTOMJZGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ran also into this, will try to work out a fix. |
X-FastAPI-Cache header is not available in fastapi-cache2 v0.2.1
The latest release v0.2.1 was from February while the source code has been modified in main branch since.
https://pypi.org/project/fastapi-cache2/#history
915f3dd
The text was updated successfully, but these errors were encountered: