glance
glance copied to clipboard
Long time to load pages with external resources
Hey there,
I'm not sure if I'm the only one who encounters the issue but I've noticed that the Glance takes ~5 seconds to load from time to time. I've testing so far which widget can cause such a long time to load, but I couldn't find which one it is. Let's say, I have weather, RSS and Twitch widgets, from time to time it takes long to open the page. I've tried to delete them one by one but apparently I've to remove all of them to make it instant to open. Call me crazy but it feels like there is some constant time that show the loading icon when there is any widget like Weather, RSS, Twitch or something that requires an external access.
I know there is a caching option, but I'm wondering is there any option to load components independently. So we could show bookmarks that are static and load in background the rest.
But as I said, I didn't saw any issue regarding this so maybe I'm the only one who experiences this.
The first open of the Glance after restart is always slow, that's obvious, the next ones are super quick, but after the cache expires I have to again wait ~5 seconds to see my bookmarks. For now, I've just moved all widgets like RSS, to another page, so I can have a fast access to bookmarks.
Hey, you haven't provided much information about your setup but just based on you mentioning that requests take ~5s, this very much sounds like #290. Could you have a look through the comments over there and confirm if your case is similar and if any of the workarounds helped?
I have come across this issue, mine specifically is FreshRSS connected to RSS widget and is down or still starting. Not a big problem for me but I can see where this can cause issues. Having each component Lazy load is actually a good suggestion for this, or at least giving it lazy-load: true option in config.
I agree. I think implementing lazy-load would solve this issue because we can expect that, at some point, there will be an extension that requires more time to load. Therefore, we shouldn't show the loading indicator for the entire view, but only for the extension.
I've tested this with v0.7.4. Here, I have the Hacker News and Lobster extensions, and this is the first page load after restarting Glance:
It looks similar for RSS.
Rate-limiting is not an issue, and I don't see any errors in the Glance logs.
Glance is amazing and I absolutely love it, it is the best idea behind the homepage for me. But yeah it really needs lazy loading, if cache expires and it re-fetches content, my instance needs ~10 seconds to load. I have a few subreddits, couple stonks, couple rss channels and like 4 youtube channels. I tried changing update intervals, but it doesn't fix the core issue. Also, remember it says 'Uncached pages usually load within 1s (depending on internet speed and number of widgets)' which is sort of true, but nobody would use it without a couple widgets, and it'll need about 5 seconds to load.
And again, glance is awesome, no pressure, and unfortunately I'm not a programmer, otherwise I'd commit myself.
Having each component Lazy load is actually a good suggestion for this, or at least giving it lazy-load: true option in config.
Implementing something like that wouldn't be too difficult, the difficult part is solving the UX problem:
Sure, you can see some widgets earlier, but you can't really use them because they'd be jumping up and down the page. The only way to partially solve this problem is to build skeleton screens for each individual widget and each different style they may have, but even then that requires guesswork about the content and there's no way to do this effectively for something like extensions.
There's no perfect solution, which is why I settled for the simpler approach of just waiting for the whole page to load and cutting slow requests early. In my opinion if something takes longer than 5 seconds to load then it's indicative of either a network issue or an issue with the server.
Also, remember it says 'Uncached pages usually load within 1s (depending on internet speed and number of widgets)' which is sort of true, but nobody would use it without a couple widgets, and it'll need about 5 seconds to load.
I didn't mean to deceive with that statement, I added it because that's been my experience for the most part with a regular 100Mbps connection and Glance running on a Pi 4, no crazy requirements for that to be true. This is the kind of load times it's supposed to have with nothing cached and a decent amount of widgets on the page. Keep in mind that this is doing a decent amount of concurrent requests: 1 for each Twitch stream, 1 for each market, 1 for each YouTube channel, 1 for each subreddit, 1 for each repository, 16 for Hacker News, 1 for Lobsters, 2 for the weather, etc. That's around 50 requests total, and a single slow one can bog the whole page down.
Based on my observations, the thing that increases load times the most is RSS feeds, so I tend to give them longer cache times and maybe get a slightly slower load time once a day. Doesn't bother me much because ultimately it's still faster than visiting all these different things individually.
This is the kind of load times it's supposed to have
Huh that's interesting, it seems to be much slower for me if nothing is cached. I'll dig more. CPU/RAM/Disk were not loaded at any point. Connection seems normal, idk.
I already got rid of RSS, although I had a few subreddits added.
Anyway, the project is great and it is now my internet home page, thank you.
Now that's amazing already
to build skeleton screens for each individual widget and each different style they may have, but even then that requires guesswork about the content and there's no way to do this effectively for something like extensions.
For extensions and custom-apis alike, how about a configuration property where a height or something can be set. Then an empty widget box with loading-icon and a height based on the property would appear. Or if loading-icon would look out of place, another property for loading style and using the predefined skeleton screen you suggest to make for other widget.
Another option here is to refresh widgets in the background according to their cache duration, so widgets are never refreshed on page load.