Hi all
As my app is gaining more features, it has become heavier and heavier. It’s come to a point where this starts to become an issue.
On certain pages, the initial html payload size is ~2.5mb, and the first message in the web socket is ~1.8mb.
The problematic pages essentially work like this:
I render ca. 100 - 1000 rich items. Each of those has a bunch of initially hidden html in them, like e.g. modals, complex menus, etc.
I use JS.toggle
etc. to show/hide these menus and modals as needed to avoid a server roundtrip.
It’s not yet a big problem, but I fear it will only get worse as I cram more features into those pages.
I have identified one somewhat easy optimization which will probably have a big impact: Icons
I’m using lucide_icons which is great, but each time an icon is used it renders the full SVG. Each menu item and button of my rich items uses an icon, so a single items renders ca. 20-30 icons. My plan is to switch to Iconify for Tailwind. I expect this to reduce the total payload size drastically.
Are there any other ways to reduce overall html size?
Should I start to use something like live_vue and define these items as vue components? Web components?
(I do not want to introduce streams / virtualized lists to render less items here, I already use those where it makes sense. Also, I do know about gzip and that this repetitive html zips very well, I still want to reduce it)