Delay Proxy is an experimental HTTPS proxy server designed for performance testing. It allows you to introduce configurable delays in the response stream to simulate different network conditions and analyze page load performance.
delay-proxy.mp4
- Caching: Caches the HTML content on the first visit.
- Configurable Delay: Streams content with a configurable delay at the
<body>tag on subsequent visits. - Cache Control: Add
?no-cacheto any URL to clear its cache. - Static Assets: Proxies static files (images, CSS, JS) without caching or delays.
-
Clone the repository:
git clone https://github.com/jantimon/delay-proxy.git cd delay-proxy -
Install the dependencies:
pnpm install
-
Generate SSL certificates:
pnpm run cert
-
Start the proxy server:
pnpm start
-
Visit the proxy server:
https://localhost:3000
You can configure the delay and split points by editing the config.json file or via the /help page provided by the server.
Here are some examples of interesting experiments you can try:
-
Streaming only until
<body>: Configure the split point to stop streaming at the<body>tag.{ "splitPoints": ["<body"] } -
Streaming after header: Configure the split point to start streaming after the header.
{ "splitPoints": ["</header>"] } -
Pausing after the LCP element (e.g., the first image): Configure the split point to pause after the LCP element.
{ "splitPoints": ["<img"] }
You can configure split chunks using regular expressions in the config.json file. This allows you to define more flexible split points.
Example:
{
"splitPoints": ["/<div class=\"layout_Page__uf51q\"/i", "/<body/i"]
}This setup can be useful for simulating different network conditions and delays for user research. By introducing controlled delays, you can observe how users interact with your website under various scenarios.
This project is licensed under the MIT License.