I have a scenario where I want to cache a JSON response and use it further. I have total two requests out of which one I want to cache and use the response in another request, however the other request should not be cached. As of now what I have tried cache's all the requests. Here is what I have tried :
import requests
import requests_cache
requests_cache.install_cache('test_cache', expire_after=120)
r = requests.get('http://localhost:5000/')
print(r.content)
r1 = requests.get('http://localhost:5000/nocach')
print(r1.content)
Here I want only the requests should be cached for r and not for r1 .
Is there any other way that supports my scenario as of now I am using requests-cache which caches all requests , however my desired scenario woudl be not to cache all request but the ones that I want to be cached for specific time.
How can I achieve this any help ?