first request is always slow
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
Solution: first request is always slow
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.
Trust Score
1 verification
- 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
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
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep