fastify / help

Need help with Fastify? File an Issue here.
https://www.fastify.io/
65 stars 8 forks source link

Slowness in responses with latest Fastify (and some core plugin) with Browser cache enabled #9

Closed smartiniOnGitHub closed 6 years ago

smartiniOnGitHub commented 6 years ago

You have already researched for similiar issues?

Yes but didn't find something similar, but I'm not sure it's a Fastify (or related plugins) bug.

What are you trying to achieve or the steps to reproduce?

Tests works good, but if I ask for pages from a Browser I alwasy have the same problem. Main source is here. Full repository is here; anyway note that I have the same problems in other projects too (but similar, and running in the same environment/platform).

What was the result you received?

With both latest Firefox and Chrome I see that if I ask for a page (like Home Page) with the Developer Console open (and cache disabled) all is good, but with cache enabled or console closed it seems that something waits for many seconds, and the page never get served completely (it seems that some linked content like the stylesheet served by 'fastify-static' is never served) ... strange.

The same happens even after changing the binding from '0.0.0.0' to '127.0.0.1'. The same happens even after completely remove the 'node_modules' folder and reinstall all dependencies.

What did you expect?

Pages loaded fast (as is was with previous Fastify releases and related plugins).

Context

Tell me if you need more info.

Thanks a lot, Sandro

mcollina commented 6 years ago

Have you tried hitting the endpoints with autocannon? Also, have you tried seeing in the network panel of devtools what is taking up so much time?

smartiniOnGitHub commented 6 years ago

Hi, I need to do some test with autocannon, and maybe even some Debug from Visual Studio Code .... In the Network panel it seems that on last resource (served by 'fastify-static' is still waiting, I wonder if it's something related to a response that will never be sent (for some reason) ... So sorry another question, to avoid some infinite wait, is it possible to apply a general timeout in all Fastify reply (I know that could be tricky when not needed) ? I'll tell you more soon ...

delvedor commented 6 years ago

Could this be related to https://github.com/fastify/fastify-static/issues/50 and https://github.com/google/node-fastify-auto-push/issues/23?

smartiniOnGitHub commented 6 years ago

@delvedor yes could be the first issue but with normal HTTP (no HTTP/2) ... So maybe I'm lucky :-) ... thanks for the help, waiting for the fix to test all ASAP.