News for hackers. Stuff that matters.
Re:Making Websites Small by bryans on Wednesday December 01, 2021 @01:43PM (#29407477)
250kb over <25 requests should really be an established standard at this point. It's not difficult to achieve and makes a massive difference in energy usage and server requirements for high traffic sites. There are plenty of <25kb frontend frameworks, and some of them are arguably better than their >100kb competitors.

I recently made a site that frontloads an entire Svelte app, every page and route, entirety of site data (120kb gzipped), all of the CSS and a font full of icons, a dozen images, service worker and manifest. Clocks in at exactly 250kb, scores 100 on LH, fully loads in 250ms uncached, and all navigation and searching is instantaneous.

That's not a brag, it just goes to show that anyone can make sites which are bandwidth and energy friendly, but for some reason very people actually do that anymore.

Re:Making Websites Small by qmmmur on Wednesday December 01, 2021 @04:45PM (#29409535)
How do you front load the whole svelte app?
Re:Making Websites Small by bryans on Wednesday December 01, 2021 @05:24PM (#29409954)
Disabling SSR and prerender within SvelteKit turns the output into an SPA, and the manualChunks option in vite-plugin-singlefile ensures the output is one file that includes every page of the site.
Re:Making Websites Small by qmmmur on Wednesday December 01, 2021 @06:11PM (#29410355)
That's pretty nice. Surely if you have a big enough site with enough content loading all of it one go is not a pleasant experience on slow connections?
Re:Making Websites Small by bryans on Wednesday December 01, 2021 @09:43PM (#29411901)
Depends on the site and content, for sure. This particular site is aggregating a subset of public profiles and posts from a social media network. To compare, the site I'm pulling the data from uses nearly 20MB to display a single uncached page of post titles and 2MB per subsequent page, while my site is able to display the entire userbase for a cost of 250kb and a single request for a ~5kb image on subsequent pages. The only difference is the choice of frameworks and component construction.
Re:Making Websites Small by qmmmur on Thursday December 02, 2021 @06:20AM (#29414792)
That's really great. Is it open source by any chance?
Re:Making Websites Small by bryans on Friday December 03, 2021 @10:21PM (#29438396)
The existing code is rather specific to that site, but I've considered making a more generalized version that could work for any small app.
Re:Making Websites Small by djbusby on Wednesday December 01, 2021 @04:28PM (#29409353)
What's LH?
Re:Making Websites Small by Lammy on Wednesday December 01, 2021 @04:49PM (#29409574)