-
I started a large batch of requests in a terminal where I was using HTTP Toolkit to examine web traffic. After a time, I decided to close HTTP Toolkit; that killed the proxy, and the terminal was no longer able to be used for HTTP fetching. So I exited that terminal, created a new one, and ran my script from the top. However, in the new terminal, the script no longer found the cached responses. 🤔 It started re-fetching everything. When I turned on the HTTP Toolkit proxy again, the cache immediately worked. I was surprised by this, because I was expecting only elements of the request that are known before sending to be used to calculate the cache key. But it seems like the network environment has something to do with generating the cache key. I presume this is where the cache key is generated. So my questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Here's some code:
|
Beta Was this translation helpful? Give feedback.
-
In general, the network environment isn't expected to affect cache keys, but I'm not specifically familiar with HTTP Toolkit. Does it rewrite URLs, add/modify request parameters or cache headers, disable SSL, or do anything else to modify requests? It should be possible to reuse your previously cached requests, either by manually modifying cache data or changing session settings. I could give an example if you can find what exactly changed. Can you show me complete info for a cached response with and without HTTP Toolkit (with any sensitive info redacted)? There's info in the docs on getting request info from the cache. |
Beta Was this translation helpful? Give feedback.
It turns out, there's a method for that! I was able to get the keys to take account of the new, proxy-less envrionment by just adding this line after creating the session:
Sorry for the spam, but maybe it will help someone in the future. And thank you so much for this incredibly useful tool!