Remove redundant calls¶
The problem¶
A web app sends the same request every 1.5 seconds, and the capture is full of them. Each one costs a request on the server, a wake-up on a phone's radio, and a line in every log. You want to know whether they carry any information, and what to change.
The solution¶
-
Find the repeat.
summaryshowed12x POST api.shop.example /v1/session/pingin its duplicate list.The group has twelve calls, all
200, so none of them failed and none were retries. -
Look at the rhythm. Are they a burst or a steady pulse?
6.0s 52ms e000038 POST api.shop.example/v1/session/ping [200] 11 B DUP 7.5s 33ms e000041 POST api.shop.example/v1/session/ping [200] 11 B DUP 9.0s 30ms e000042 POST api.shop.example/v1/session/ping [200] 11 B DUP 10.5s 50ms e000050 POST api.shop.example/v1/session/ping [200] 11 B DUP 12.0s 42ms e000052 POST api.shop.example/v1/session/ping [200] 11 B DUPOne call every 1.5 seconds, each answered in about 30 to 50 ms. A heartbeat.
-
Ask what differs. If the calls carry no new information, they are redundant.
volatile-onlymeans the bodies differ only in keys that look like clocks. No query parameter and no header changes. Check which key, because the verdict is broad (see What varies between calls):The only thing that changes is
ts, a timestamp that moves by 1.5 seconds each time. -
Check the second kind of duplicate.
/v1/flagsalso repeats six times, with a differentcbon each call:6x GET api.shop.example/v1/flags statuses: 200:6 entries: e000019, e000040, e000051, e000061, e000066, e000071cbis a cache-buster, so these requests are asked as new ones each time and the server cannot answer from a cache. WireTrail ignorescbwhen it groups, which is how six different URLs became one group. -
Decide what to change. The heartbeat carries no information beyond "still here". Send it less often, or send it only when the connection needs it. The flags call needs a stable URL and a cache header, so that the repeats are answered from cache. Then capture again.
-
Check the result. The earlier build did this better. Its capture has three pings, not twelve:
How it works¶
duplicates finds the repeat and timeline shows whether it is a burst or a rhythm. diff separates a call that
changes from one that does not, and extract names the field. The volatile-only verdict is the key evidence:
with no query, header or body change that matters, the calls cannot be asking for different things.
Variations¶
- The calls are retries. A group tagged
[retry pattern]follows failures. See Retries. - The calls differ in the path. Twelve calls to
/v1/products/{id}/priceare one group after normalization, but they ask for twelve things. That is an N+1, anddiffshows nothing for it. - You cannot change the client. Add
Cache-Controlon the server for the idempotent GETs, and measure withcompare.
Related¶
- Duplicates explains the fingerprint.
- What varies between calls explains the verdicts.
- Catch a regression before it ships keeps the improvement.