New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page delay on first load on publish (locally too). #1354
Comments
Probably it caused by |
Thanks for answer, but this not because i have commented it. |
Just to make sure, did you compile the app via |
yeah i am doing npm run build -- -- release. The site give pingdom give me some suggestions.
Also i am using some external css and the site say this:
Also on server.js file i used
And this improved a little the load time of page, about 1-2 sec |
It is still too long. You must doing something nasty in server. Is this happening only on very first request to the server or every fresh browser will take a lot of time? |
Can you avoid execution of any of your middleware? |
I am using feathers js -sequelize as middlware.For getting data. My page data based on db , so i cannot remove middleware for feathersjs. |
@Shadowman4205 See magic of Run |
@langpavel Sorry for inconvience, to get ur result do i put this in specific part on server.js or i have to put it on all functions/modules that i want track? |
@Shadowman4205 Just set this environment variable and figure out what is taking so much time when you making request.. Not all modules use |
@langpavel ok thank you very much, i just copied ur command on cmder, but i am on windows i had to do |
After running this command, when i go to load 1st page the first command take 6s.
is this normal? |
@Shadowman4205 What preceding this line? |
@langpavel after testing app and using cache for data somehow i reduced the time. |
3 sec are bad. How performant is your machine? Focus on really unoptimized and unneeded code paths. I have background database proccess running which consumes 98% of CPU now, but page is rendered in ~700ms. First rendered content I have in cca 2s after I press enter. But after first load everything behaves smoothly even on slow connections, so this is price for prerendered SPA. Note that I have no optimization and RSK is without cache in default (see #1245).. |
@langpavel |
@Shadowman4205 await Promise.all(loadData1(), loadData2()) and make sure that if you parallelize promises your database driver will use two connection from the pool, otherwise this will have no effect. |
@langpavel |
@Shadowman4205 Node server is long living process. You can use something like LRU cache and feed store from it. LRU caches can implement max age etc… If your data updates really rarely, you can preload them once at process start, but I cannot recommend this for nothing except statics (files, really static data etc..) <-- you will need server restart to reload this.. |
@langpavel thank you very much, you helped me a lot. Lots of good and new for me recommendations. |
@langpavel Sorry for inconvience, on stress test with siege in ur react starter kit demo and mine app based on this starter kit we getting similar error with socket:
for reproduce you can run command: siege -d1 -c100 https://demo.reactstarter.com/ |
Hmm, weird, can you catch content of 503 response? |
i tried catch with winston exception handler but it did not catch it. |
@Shadowman4205 thank you very much for crating this issue! Unfortunately, we have close it due to inactivity. Feel free to re-open it or join our Discord channel for discussion. NOTE: The |
Hello, i have published page and saw there is delaya on initial load the page and i do not mean in data load from database. I just used pingdom and saw there is delay.
If check ur demo site demosite
You will see the orange one wait 153ms. In my site it is 4.08 sec.
Also like ur and mine first page is too big
In ur Demosite -> 4.4 MB because of Script 1.33 MB
In my site -> 5.1 MB script 2.15
Also is normal for vendor.js be 1.6MB?
Any suggestion or guideline where to look or check this better?
The text was updated successfully, but these errors were encountered: