Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Fix slow response time of requests #66

Merged
merged 1 commit into from
Sep 30, 2020
Merged

Fix slow response time of requests #66

merged 1 commit into from
Sep 30, 2020

Conversation

eddami
Copy link
Contributor

@eddami eddami commented Aug 28, 2020

I've noticed that the response times of requests going through this middleware are slow (2s-4s in my case).
After a bit of investigation, i found this discussion about UseProxyToSpaDevelopmentServer which is used internally in this library.
It turns out that webpack/nodejs server is listening to IPv4 only. However, SpaProxy on localhost tries IPv6 first so it takes few seconds before trying IPv4.
The solution is to target 127.0.0.1 directly.

This is some timing analysis:
With localhost:
Annotation 2020-08-28 191151

With 127.0.0.1:
Annotation 2020-08-28 191449

@EEParker EEParker merged commit 0cb1498 into EEParker:master Sep 30, 2020
@EEParker
Copy link
Owner

Thank you for the PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants