HN2new | past | comments | ask | show | jobs | submitlogin
You don't need external assets in an HTML file (shkspr.mobi)
31 points by gildas on Aug 3, 2021 | hide | past | favorite | 11 comments


Of all the web pages I have from 20+ years ago for things like directories of files or collections of documents, the ones that are broken now are the ones with assets split out. Their folders get clobbered or separated from their index files and everything broke during some data migration to a new hard drive or whatever. The ones with the css or js inline still largely work. Images usually aren't base64 encoded but these don't have many images anyway. I've always thought I should reconsider doing simple, single file applications more for things I want to archive into the distant future.


Wouldn't splitting an HTML file into a list of linked files speed up the download process?

Instead of one large blob, a number of smaller files can be downloaded in parallel.


Yes... particularly when you cache the assets.

Also, Data URLs aren't supported evenly across browsers.

It's like people are slowly unlearning how the web is supposed to work.


SingleFileZ is supposed to be used to archive webpages.


I wish more people do that with their Web pages. It wouldn't work with Web Apps or some sort of interactive web page. But there are lots of web that fit into simple web page category and really doesn't need all the complexity.


This makes pages far more complex than just linking to the assets.


I had once created a webpack config which automated that. Helped a lot when applying front-end jobs, where they gave you a take-home test, so I could just attach the single html when I wanted to deliver the results.


Its much more usable now that IDEs can shrink 10000 character base64 data for display and display image previews if you hover over them. Internet connections are no longer that you need to wait 30 seconds after text has loading for 50kb of images. Can't wait for the utopia without PDFs and MS Office formats, the relics of printer and projector era... and the mixed bag of wasm powered apps delivered as self contained html (download a tax calculator page, fill it and email it to a friend for checking, file it to the government).


Once you have multiple pages, and moderately sized CSS/JS files, linking to them reduces the download time for each subsequent page, as the linked files are cached across pages.


It's a bit like what the SingleFile extension does. You get a single HTML file with all the assets inside it. I like to use it when I want to save a page


So it is a Single File Application. Everything downloaded in a Single http request.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: