Mocking strict hourly APIs to test cache stampedes

Archived topic — some details may be out of date.
Mock servers built from saved collection examples are still supported. Postman now also has code-based mocks: JavaScript request handlers plus a config.yaml, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (postman mock generate) and run it (postman mock run). See About mocks and Create a mock.
Working with an AI coding agent? The Postman plugin can build and run mocks for you.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

Hi everyone,

I’m currently building a live electricity price-tracking dashboard: https://sahkotanaan.fi/. The core of the app relies on a regional utility API that publishes new exchange rates exactly once per hour.

Because the third-party API has incredibly strict rate limits, I’ve set up a middleware caching layer. My server runs a cron job at the top of the hour, fetches the new JSON payload, caches it, and my frontend tools only ever talk to my cache.

The architecture works, but I am struggling with how to properly test edge cases—specifically the “cache stampede” scenario. I need to simulate a spike of concurrent users hitting my endpoints at exactly the top of the hour when the cache is invalidating and fetching the new data.

My main concern is doing this without accidentally letting a test script slip through and hammer the real third-party API, which would get my production IP blacklisted.

For those of you who manage time-sensitive proxy setups, I’d love to get your thoughts:

  1. How do you approach mocking a strict, time-based third-party API in Postman so you can safely load test your own middleware?
  2. Do you have a specific Postman/Newman workflow you use to simulate concurrent requests hitting at the exact moment a cache expires?
  3. Do you usually build the mock server to simulate the latency of the third-party API to see how your backend handles the pending frontend requests?

Thanks in advance!