Cache requests/response.
See original GitHub issueI use mitmproxy
a lot for developing scripts that scrap external content. I often find that it takes a long time to test script because it needs to repeat all the HTTP requests. It would be nice if it was able to select HTTP requests that mitmproxy
would cache and use cached version to reply to the user.
The most common use case scenario is GET requests because those are supposed to be immutable.
I have built a node web-proxy script to do this for me, using it as a forward proxy together with mitmproxy
, though it would be nice if mitmproxy
supported this natively.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
HTTP caching - MDN Web Docs
The HTTP cache stores a response associated with a request and reuses the stored response for subsequent requests.
Read more >Prevent unnecessary network requests with the HTTP Cache
All HTTP requests that the browser makes are first routed to the browser cache to check whether there is a valid cached response...
Read more >Caching REST API Response
Caching is the ability to store copies of frequently accessed data in several places along the request-response path.
Read more >What is Cache-Control and How HTTP Cache Headers Work
What is the Cache-Control Header. Cache-control is an HTTP header used to specify browser caching policies in both client requests and server responses....
Read more >requests-cache 0.9.7 documentation
Ease of use: Keep using the requests library you're already familiar with. · Performance: Get sub-millisecond response times for cached responses. ·
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gajus, I recorded a session into a file and was able to repeatedly return the results using the
--no-pop
parametermitmproxy -S /sites/dsi.site --no-pop
The responses live in a queue, which is why the responses are only replayed once, the--no-pop
command tells mitmproxy to leave the responses in a queue so they can be returned ad-infinitumI am sure you are able to do it using mitmproxy with a bit of Python skills, though.