FG
📡 Networking

first request is always slow

Freshabout 14 years ago
Mar 14, 20260 views
Confidence Score85%
85%

Problem

Hello, I am having an issue where the first request to any domain which is handled by the proxy appears to take 2-3 seconds to load before it actually does. This was all running on a dedicated server, so I tried it out locally and had the same issue, so I set it up locally on another pc (for sanity sake) and the issue is still happening. This is the code I am using: > var proxy = require("http-proxy"); > > proxy.createServer({ > hostnameOnly: true, > router: { > "admin.local": "localhost:8081", > "web.local": "localhost:8080" > } > }).listen(80); Seems to be happening on every version of node I have tested with (0.6.6, 0.6) Is this a known issue with 0.6 compatibility, is this a known performance tradeoff when proxying like this? Have I done something silly? I am not sure! Some clarity as to why this issue might be happening and would be great. Thanks! edit: The platforms I have tested this with are (osx 10.6, 10.7 and freebsd 8.2)

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: first request is always slow

Low Risk

Can you try using node's core http.request method or use mikeal's `request` library? You should be able to get the same functionality, and be able to possibly isolate the performance bottleneck.

84

Trust Score

1 verification

100% success
  1. 1

    Can you try using node's core http.request method or use mikeal's `request` libr

    Can you try using node's core http.request method or use mikeal's `request` library?

  2. 2

    You should be able to get the same functionality, and be able to possibly isolat

    You should be able to get the same functionality, and be able to possibly isolate the performance bottleneck.

Validation

Resolved in http-party/node-http-proxy GitHub issue #171. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

proxyhttpnode.jsmedium-priorityneeds-investigation