jawah / niquests

“Safest, Fastest, Easiest, and Most advanced” Python HTTP Client. Production Ready! Drop-in replacement for Requests. HTTP/1.1, HTTP/2, and HTTP/3 supported.
https://niquests.readthedocs.io/en/latest/
Apache License 2.0
811 stars 19 forks source link

caching requests #115

Closed ArtemIsmagilov closed 5 months ago

ArtemIsmagilov commented 5 months ago

Having read your source code, I see that you cache any client requests to the server. perhaps this really increases the speed of information transfer. won't this interfere with the display of real data from the server? After all, the result is not from the server, but from the cache? It seems that I do not understand the ideal architecture of http clients at a professional level. Why such a multiple increase in productivity? It seems like an IO bound operation and we’re just waiting and parsing the metadata...

Ousret commented 5 months ago

You are mistaken. We do not cache the response neither we cache the request. It is not Niquests job to cache a server response. You probably misinterpreted some minor optimization for caching either the request or response. try to assemble a piece of code that shows exactly that, you will see that it is not.

regards,

ArtemIsmagilov commented 5 months ago

@Ousret, I apologize, apparently I didn’t understand the following part of the code correctly. thank you very much for the clarification on this issue. https://github.com/jawah/niquests/blob/66f5ceab5b0ed36fe350f4ee8f81e377351249df/src/niquests/_async.py#L227

Ousret commented 5 months ago

No worries. It happen.