first request is always slow
Created by: ghost
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)