# Server Replay Without Timing

**URL:** <https://discourse.mitmproxy.org/t/server-replay-without-timing/1015>\
**Category:** help\
**Created:** [April 26, 2018, 8:20pm UTC](https://discourse.mitmproxy.org/t/server-replay-without-timing/1015 "2018-04-26T20:20:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davertron](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/davertron/32/302_2.png) [@davertron](https://discourse.mitmproxy.org/u/davertron)\
**Post date:** [April 26, 2018, 8:20pm UTC](https://discourse.mitmproxy.org/t/server-replay-without-timing/1015/1 "2018-04-26T20:20:25Z")

</div>

I’m trying to understand the server replay feature a little better. What I want to do is pretty straight-forward:

The first time a server makes a request to a url, serve the response and then cache it locally. Every subsequent request should be served immediately from cache.

I don’t want to “replay” the response exactly the same way it was originally served because it’s slow on the first request (i.e. it takes 15s to respond on the first time, I want it to basically be instantaneous after that).

Is this the right tool for the job? I know I could probably use Squid or some other proxy, but I want to use mitmproxy for other things (rewriting responses etc.) and so it would be great if I could use a single tool, and it seems possible. Maybe I need to write my own addon though?

Any help better understanding the server replay feature would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![davertron](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/davertron/32/302_2.png) [@davertron](https://discourse.mitmproxy.org/u/davertron)\
**Post date:** [April 27, 2018, 3:24am UTC](https://discourse.mitmproxy.org/t/server-replay-without-timing/1015/2 "2018-04-27T03:24:25Z")

</div>

Just wanted to leave an update here, I used the replay feature, saved out the flow response to a file, then used

`mitmweb --mode reverse:http://localhost:3000 -S saved_flow --server-replay-nopop`

This did exactly what I wanted.

---

<div class="post-metadata">

**Author:** ![asulta](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mitmproxy.org/asulta/32/426_2.png) [@asulta](https://discourse.mitmproxy.org/u/asulta)\
**Post date:** [May 3, 2019, 9:43am UTC](https://discourse.mitmproxy.org/t/server-replay-without-timing/1015/3 "2019-05-03T09:43:12Z")

</div>

I need to cache each response received with mitmproxy, I already recorded and replayed the cached requests but I have the same issue as you, the time to get the actual response also gets replayed, but I want it to be instantaneous.

The machine is making multiple requests to multiple servers, so I don’t quite understand what should be defined as reverse proxy url.

> [@davertron](#):
>
> `--mode reverse:http://localhost:3000`

Can anyone help me to understand what should be used here?
