4

I am using Vue.js's API proxying functionality (which internally uses http-proxy-middleware/http-proxy) to forward API requests to my localbackend server. I set it in vue.conf.js like so:

module.exports = {
    devServer: {
        port: 8081,
        proxy: {
            '/api': {
                target: 'http://localhost:8080',
                xfwd: false
            }
        }
    }
}

For some weird reason though, about every other proxied request coming from Chrome is slow:

Slow requests

When a slow request is profiled in Chrome, it looks like below: enter image description here

Any idea what might be causing this delay between fetchStart and requestStart? When accessing the proxy through 127.0.0.1, the problem goes away for some reason (DNS issues???). Checked the backend, and it responds correctly as well. The problem doesn't exist on Firefox either.

System is latest Win10, checked on stable and canary Chrome.

Docent
  • 271
  • 1
  • 8

0 Answers0