News for hackers. Stuff that matters.
Re:Show HN: I made a website even my tech un-savvy parents c... by pcloadletter_ on Saturday March 09, 2024 @03:57PM (#39654670)
The "zippy" client stuff comes at a cost: my browser has to download ~150kb of javascript to make this website work. Not as bloated as many sites but more JS than is truly needed for this sort of thing. Likely framework bloat.
Re:Show HN: I made a website even my tech un-savvy parents c... by misterrpink on Saturday March 09, 2024 @04:34PM (#39654941)
yea this will become a problem at scale but nothing that can't be fixed
Re:Show HN: I made a website even my tech un-savvy parents c... by misterrpink on Saturday March 09, 2024 @04:35PM (#39654944)
Wait I don't see a payload coming in on page load. OP might just have hardcoded json objects into client side
Re:Show HN: I made a website even my tech un-savvy parents c... by bazil376 on Saturday March 09, 2024 @04:42PM (#39654969)
This is kind of correct, but hardcoded sounds a bit worse than it actually is. Basically a cron job updates the JSON file and injects it as a JS object into the bundle
Re:Show HN: I made a website even my tech un-savvy parents c... by jotaen on Sunday March 10, 2024 @01:38PM (#39660931)
150K worth of JS doesn’t seem too bad in my eyes, considering the level of interactivity here (not just for the filtering, but also for the input dialog). Almost half of the 150K is actual data, which is embedded into the JS file directly.

To put things into perspective: the preview images are around 20–60K each, so if you scroll the entire list, you end up downloading ~5M. If at all, this is where I’d start to look at in terms of optimising bandwidth.

Re:Show HN: I made a website even my tech un-savvy parents c... by pcloadletter_ on Sunday March 10, 2024 @04:21PM (#39662264)
I did not realize half the payload was the data itself!