2 ms·
Personally, I started building tooling around Data URIs to provide permanent archives to external resources. You can only really store text or single images lik
by bArray 2y ago
Personally, I started building tooling around Data URIs to provide permanent archives to external resources. You can only really store text or single images like this, and you have to get the size below 16KB [1] (64kB at a push) to be reliable. You can do some form of compression, but it would be nicer to have support for longer Data URIs.
I've literally embedded these into PDFs and all sorts, all of which still open today. It doesn't really increase the document size notably, but does make them more robust.
[1] https://stackoverflow.com/a/695167 https://stackoverflow.com/a/695167
- nikisweeting 2y agoThis is how singlefile and some other archiving tools work, they just embed all remote assets as data urls within the page. It works really well, the only inconvenience is if you need to parse the html later on, the massive attribute lengths can crash some html parsers like jsdom or cheerio.