rajnandan1 / kener

Kener is a Modern Self hosted Status Page, batteries included
https://kener.ing/
MIT License
2.5k stars 104 forks source link

Slow to render main page #40

Closed rayjanoka closed 10 months ago

rayjanoka commented 10 months ago

Describe the bug

Hi, love the site, we are using it in production now!

But it is taking over 2 seconds to render the main page with 5 monitors.

Is there anything we can do to speed it up? Maybe send the headers to allow caching for a minute or two?

Lighthouse Report image

rajnandan1 commented 10 months ago

Is there a public link? Would like to do a deeper analysis

rayjanoka commented 10 months ago

Is there a public link? Would like to do a deeper analysis

yes! https://status.minehut.com

rajnandan1 commented 10 months ago

I can see there is no reverse proxy. one thing you can do for now is add gzip compression You can modify the prod.js file https://expressjs.com/en/advanced/best-practice-performance.html#use-gzip-compression

I will add these functionalities as configuration

rayjanoka commented 10 months ago

Ok, gzip compression is something.

Actually I am running traefik as my proxy, is there something we could do there? thanks!

rajnandan1 commented 10 months ago

I see the scores have improved a lot. Did you do something?

Screenshot 2024-01-25 at 11 07 00 PM
rayjanoka commented 10 months ago

I did add the compression, but the score was always high. if you look down further you will see it in the details.

The issue appears to be a mixture of reading the json and talking to github.

On my local system with a small json and no github configured I get 200ms, with a larger json (8 days worth) it goes up quite a bit to 1.2 seconds, then when I connect it to github it goes up to 3.5 seconds.

I'm not sure why it is higher than yesterday's 2.5 seconds now, maybe github is just slower today...

image

rajnandan1 commented 10 months ago

I have done some optimization, do test. Closing this ticket. Instead of making multiple API calls, calling Github just once on initial load. Please free to reopen

rayjanoka commented 10 months ago

appreciate it @rajnandan1. I will give it a go!