22 comments

  • simonw14 hours ago
    TIL about window.stop() - the key to this entire thing working, it&#x27;s causes the browser to stop loading any more assets: <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Window&#x2F;stop" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Window&#x2F;stop</a><p>Apparently every important browser has supported it for well over a decade: <a href="https:&#x2F;&#x2F;caniuse.com&#x2F;mdn-api_window_stop" rel="nofollow">https:&#x2F;&#x2F;caniuse.com&#x2F;mdn-api_window_stop</a><p>Here&#x27;s a screenshot illustrating how window.stop() is used - <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;simonw&#x2F;7bf5912f3520a1a9ad294cd747b851d6?permalink_comment_id=5988313#gistcomment-5988313" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;simonw&#x2F;7bf5912f3520a1a9ad294cd747b85...</a> - everything after &lt;!-- GWTAR END is tar compressed data.<p>Posted some more notes on my blog: <a href="https:&#x2F;&#x2F;simonwillison.net&#x2F;2026&#x2F;Feb&#x2F;15&#x2F;gwtar&#x2F;" rel="nofollow">https:&#x2F;&#x2F;simonwillison.net&#x2F;2026&#x2F;Feb&#x2F;15&#x2F;gwtar&#x2F;</a>
    • Lerc7 hours ago
      I wonder if this is compatible with Claude Artifacts.<p>I made my own bundler skill that lets me publish artifacts <a href="https:&#x2F;&#x2F;claude.ai&#x2F;public&#x2F;artifacts&#x2F;a49d53b6-93ee-4891-b5f1-918ab5160da8" rel="nofollow">https:&#x2F;&#x2F;claude.ai&#x2F;public&#x2F;artifacts&#x2F;a49d53b6-93ee-4891-b5f1-9...</a> that can be decomposed back into the files, but it is just a compressed base64 chunk at the end.<p>I guess the next question will be if it does work in environments that let you share a single file, will they disable this ability once they find out people are using it.
    • moritzwarhier13 hours ago
      Not the inverse, but for any SPA (not framework or library) developers seeing this, it&#x27;s probably worth noting that this is not better than using document.write, window.open and simular APIs.<p>But could be very interesting for use cases where the main logic lives on the server and people try to manually implement some download- and&#x2F;or lazy-loading logic.<p>Still probably bad unless you&#x27;re explicitly working on init and redirect scripts.
    • 8n4vidtmkvmk13 hours ago
      Neat! I didn&#x27;t know about this either.<p>Php has a similar feature called __halt_compiler() which I&#x27;ve used for a similar purpose. Or sometimes just to put documentation at the end of a file without needing a comment block.
  • tym012 hours ago
    I was on board until I saw that those can&#x27;t easily be opened from a local file. Seems like local access is one of the main use case for archival formats.
    • avaer12 hours ago
      Agreed, I was thinking it&#x27;s like asm.js where it can &quot;backdoor pilot&quot; [1] an interesting use case into the browser by making it already supported by default.<p>But not being able to &quot;just&quot; load the file into a browser locally seems to defeat a lot of the point.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Television_pilot#Backdoor_pilot" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Television_pilot#Backdoor_pilo...</a>
    • deevus7 hours ago
      Could it be solved with a viewer program? Any static HTML server?
    • NoMoreNicksLeft4 hours ago
      Html is already a good single-file html format. Images can be inlined with data-uri. CSS and javascript have been inlineable since the very beginning. What more is needed? Fonts? Data-uri, once more.<p>Hell, html is probably what word processor apps should be saving everything as. You can get pixel-level placement of any element if you want that.
    • vessenes5 hours ago
      I mean `claude -p &quot;spin up a python webserver in this directory please&quot;` or alternately `python -m http.server 8080 --bind 127.0.0.1 --directory .` is not hard
      • chungy1 hour ago
        althttpd is even easier. :)
  • zetanor14 hours ago
    The author dismisses WARC, but I don&#x27;t see why. To me, Gwtar seems <i>more</i> complicated than a WARC, while being less flexible and while also being yet another new format thrown onto the pile.
    • simonw14 hours ago
      I don&#x27;t think you can provide a URL to a WARC that can be clicked to view its content directly in your browser.
      • zetanor13 hours ago
        At the very least, WARC could have been used as the container (&quot;tar&quot;) format after the preamble of Gwtar. But even there, given that this format doesn&#x27;t work without a web server (unlike SingleFile, mentioned in the article), I feel like there&#x27;s a lot to gain by separating the &quot;viewer&quot; (Gwtar&#x27;s javascript) from the content, such that the viewer can be updated over time without changing the archives.<p>I certainly could be missing something (I&#x27;ve thought about this problem for all of a few minutes here), but surely you could host &quot;warcviewer.html&quot; and &quot;warcviewer.js&quot; next to &quot;mycoolwarc.warc&quot; &quot;mycoolwrc.cdx&quot; with little to no loss of convenience, and call it a day?
        • gwern10 hours ago
          You could potentially use WARC instead of Tar as the appended container, sure, but that&#x27;s a lot of complexity, WARC doesn&#x27;t serialize the rendered page (so what is the greater &#x27;fidelity&#x27; actually getting you?) and SingleFile doesn&#x27;t support WARC, and I don&#x27;t see a specific advantage that a Gwtar using WARC would have. The page rendered what it rendered.<p>And if you choose to require separate files and break single-file, then you have many options.<p>&gt; surely you could host &quot;warcviewer.html&quot; and &quot;warcviewer.js&quot; next to &quot;mycoolwarc.warc&quot; &quot;mycoolwrc.cdx&quot;<p>I&#x27;m not familiar with warcviewer.js and Googling isn&#x27;t showing it. Are you thinking of <a href="https:&#x2F;&#x2F;github.com&#x2F;webrecorder&#x2F;wabac.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;webrecorder&#x2F;wabac.js</a> ?
          • zetanor8 hours ago
            I should have been a bit more verbose as I didn&#x27;t mean to send anyone on a wild goose chase. The &quot;warcviewer.{html,js}&quot; part was just a hypothetical viewer to illustrate having a static client-side &quot;web app&quot; that functions much like Gwtar, but separately from payloads.<p>To expand what I have in mind, it&#x27;d be a script like Gwtar, except it loads WARCs through URLs to CDX files. Alternatively, it might also load WARC files fully to memory, where an index could be constructed on the fly. In the latter case, that would allow the same viewer to be used with or without a web server. Though, I can imagine that loading archives without a web server was probably out-of-scope for Gwtar, otherwise something could have been figured out (e.g., putting the tar in a &lt;textarea&gt;&#x27;s RCDATA; do browsers support &quot;binary&quot; data in there correctly?).<p>While the WARC specs are a mess (sometimes quite ambiguous), I&#x27;ve never had much trouble reading or writing them. As for <i>why</i> WARC, having the option to preserve request&#x2F;response metadata, as well as having interoperability with anything else in the WARC ecosystem, would be nice. Also, a separate viewer would naturally be updateable without changing the archive files themselves.
            • gwern8 hours ago
              I see. You could probably build something on top of wabac.js... But you&#x27;d need some sort of multi-file setup to support the indirection, I suppose.<p>&gt; I imagine that loading archives without a web server was probably out-of-scope for Gwtar<p>More that it&#x27;s just not important to us. I don&#x27;t even look at the archives &#x27;locally&#x27;. They are all archives of public web pages, which I just rehost publicly. When I want to look at them, I open them on Gwern.net like anyone else!<p>And if I really needed to, for some reason, it&#x27;s literally a Bash one-liner (already provided inside the Gwtar as well as my writeup) to turn them back into a normal multi-file HTML. (This is a lot more than you can say for a WARC...) So my reaction to the complaints about lacking local viewing is mostly just ¯\_(ツ)_&#x2F;¯<p>&gt; (e.g., putting the tar in a &lt;textarea&gt;&#x27;s RCDATA; I wonder how well browsers support &quot;binary&quot; data in there?)<p>I don&#x27;t know the details but you can just base-encode them, so I suppose that&#x27;s an option, as long as you rewrote the ranges appropriately, maybe?<p>(Also worth noting that you can go the other way: if you really desperately want to preserve the raw header responses, you can just use the flexibility of Gwtar to append the WARC to the end of the file. As long as the range requests work, users won&#x27;t download that part. The duplication is not so great for long-term storage, but you can just XZ them and that should remove duplication and overhead.)
    • obscurette13 hours ago
      WARC is mentioned with very specific reason not being good enough: &quot;WARCs&#x2F;WACZs achieve static and efficient, but not single (because while the WARC is a single file, it relies on a complex software installation like WebRecorder&#x2F;Replay Webpage to display).&quot;
  • gildas10 hours ago
    I would like to know why ZIP&#x2F;HTML polyglot format produced by SingleFile [1] and mentioned in the article &quot;achieve static, single, but not efficiency&quot;. What&#x27;s not efficient compared to the gwtar format?<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;gildas-lormeau&#x2F;Polyglot-HTML-ZIP-PNG" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gildas-lormeau&#x2F;Polyglot-HTML-ZIP-PNG</a>
    • gwern10 hours ago
      &#x27;efficiency&#x27; is downloading only the assets needed to render the current view. How does it implement range requests and avoid downloading the entire SingleFileZ when a web browser requests the URL?
      • gildas10 hours ago
        I haven&#x27;t looked closely, but I get the impression that this is an implementation detail which is not really related to the format. In this case, a polyglot zip&#x2F;html file could also interrupt page loading via a window.stop() call and rely on range requests (zip.js supports them) to unzip and display the page. This could also be transparent for the user, depending on whether the file is served via HTTP or not. However, I admit that I haven&#x27;t implemented this mechanism yet.
        • gwern10 hours ago
          &gt; that this is an implementation detail which is not really related to the format. In this case, a polyglot zip&#x2F;html file could also interrupt page loading via a window.stop() call...However, I admit that I haven&#x27;t implemented this mechanism yet.<p>Well, yes. That&#x27;s why we created Gwtar and I didn&#x27;t just use SingleFileZ. We would have preferred to not go to all this trouble and use someone else&#x27;s maintained tool, but if it&#x27;s not implemented, then I can&#x27;t use it.<p>(Also, if it had been obvious to you how to do this window.stop+range-request trick beforehand, and you just hadn&#x27;t gotten around to implementing it, it would have been nice if you had written it up somewhere more prominent; I was unable to find any prior art or discussion.)
          • gildas10 hours ago
            The reason I did not implement the innovative mechanism you describe is because, in my case, all the technical effort was&#x2F;is focused on reading the archive from the filesystem. No one has suggested it either.<p>Edit: Actually, SingleFile already calls window.stop() when displaying a zip&#x2F;html file from HTTP, see <a href="https:&#x2F;&#x2F;github.com&#x2F;gildas-lormeau&#x2F;single-file-core&#x2F;blob&#x2F;22fc429b766d88bae1a9755896a92d9def6e0a37&#x2F;processors&#x2F;compression&#x2F;compression.js#L441" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gildas-lormeau&#x2F;single-file-core&#x2F;blob&#x2F;22fc...</a>
            • gwern9 hours ago
              What does that do?
              • gildas9 hours ago
                The call to window.stop() stops HTML parsing&#x2F;rendering, which is unnecessary since the script has downloaded the page via HTTP and will decompress it as-is as a binary file (zip.js supports concatenated payloads before and after the zip data). However, in my case, the call to window.stop() is executed asynchronously once the binary has been downloaded, and therefore may be too late. This is probably less effective than in your case with gtwar.<p>I implemented this in the simplest way possible because if the zip file is read from the filesystem, window.stop() must not be called immediately because the file must be parsed entirely. In my case, it would require slightly more complex logic to call window.stop() as early as possible.<p>Edit: Maybe it&#x27;s totally useless though, as documented here [1]: &quot;Because of how scripts are executed, this method cannot interrupt its parent document&#x27;s loading, but it will stop its images, new windows, and other still-loading objects.&quot; (you mentioned it in the article)<p>[1] <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Window&#x2F;stop" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Window&#x2F;stop</a><p>Edit #2: Since I didn&#x27;t know that window.call() was most likely useless in my case, I understand your approach much better now. Thank you very much for clarifying that with your question!
                • gwern8 hours ago
                  Well, it seems easy enough to test if you think you are getting efficiency &#x27;for free&#x27;. Dump a 10GB binary into a SingleFileZ, and see if your browser freezes.
                  • gildas8 hours ago
                    I just ran a test on a 10GB HTML page and called window.stop() via a 100ms setTimeout, which, in my opinion, simulates what would happen in a better-implemented case in SingleFile if the call to window.stop() were made as soon as the HTTP headers of the fetch request are received (i.e. easy fix). And it actually works. It interrupts the loading at approx. 15MB of data, the rendering of the page, and it&#x27;s partially and smoothly displayed (no freeze). So it&#x27;s not totally useless but it deserves to be optimized at a minimum in SingleFile, as I indicated. In the end, the MDN documentation is not very clear...<p>Edit: I&#x27;ve just implemented the &quot;good enough of my machine fix&quot; aka the &quot;easy fix&quot;, <a href="https:&#x2F;&#x2F;github.com&#x2F;gildas-lormeau&#x2F;single-file-core&#x2F;commit&#x2F;a08c69fa1a417b6fccdeeeeb6c20c4faeff59b21" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gildas-lormeau&#x2F;single-file-core&#x2F;commit&#x2F;a0...</a>.<p>Edit #2: I&#x27;ve just understood that &quot;parent&quot; in &quot;this method cannot interrupt its *parent* document&#x27;s loading&quot; from the MDN doc probably means the &quot;parent&quot; of the frame (when the script is running into it).
  • pseudosavant8 hours ago
    I’ve thought about doing something similar, but at the Service Worker layer so the page stays the same and all HTTP requests are intercepted.<p>Similar to the window.stop() approach, requests would truncate the main HTML file while the rest of that request would be the assets blob that the service worker would then serve up.<p>The service worker file could be a dataURI to keep this in one file.
  • calebm11 hours ago
    Very cool idea. I think single-file HTML web apps are the most durable form of computer software. A few examples of Single-File Web Apps that I wrote are: <a href="https:&#x2F;&#x2F;fuzzygraph.com" rel="nofollow">https:&#x2F;&#x2F;fuzzygraph.com</a> and <a href="https:&#x2F;&#x2F;hypervault.github.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hypervault.github.io&#x2F;</a>.
  • overgard7 hours ago
    Interesting, but I&#x27;m kind of confused why you&#x27;d need lazy loads for a local file? Like, how big are these files expected to be? (Or is the lazy loading just to support lazy loading its already doing?)
    • skybrian7 hours ago
      I believe the idea is that it&#x27;s <i>not</i> local. It&#x27;s a very large file on an HTTP server (required for range requests) and you don&#x27;t want to download the whole thing over the network.<p>Of course, since it&#x27;s on an HTTP server, it could easily handle doing multiple requests of different files, but sometimes that&#x27;s inconvenient to manage on the server and a single file would be easier.<p>Maybe this is downstream of Gwern choosing to use MediaWiki for his website?
      • gwern1 hour ago
        Yes, network is assumed. If it&#x27;s local, there&#x27;s no problem, just use MHT or SingleFile!<p>&gt; Maybe this is downstream of Gwern choosing to use MediaWiki for his website?<p>This has nothing at all to do with the choice of server. The benefit of being a single-file, with zero configuration or special software required by anyone who ever hosts or rehosts a Gwtar in the future, would be true regardless of what wiki software I run.<p>(As it happens, Gwern.net has never used MediaWiki, or any standard dynamic CMS. It started as Gitit, and is now a very customized Hakyll static site with a lot of nginx options. I am surprised you thought that because Gwern.net looks nothing like any MediaWiki installation I have seen.)
        • skybrian35 minutes ago
          Yeah I&#x27;m not sure why I thought that.
  • mr_mitm12 hours ago
    Pretty cool. I made something similar (much more hacky) a while ago: <a href="https:&#x2F;&#x2F;github.com&#x2F;AdrianVollmer&#x2F;Zundler" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;AdrianVollmer&#x2F;Zundler</a><p>Works locally, but it does need to decompress everything first thing.
    • gwern11 hours ago
      So this is like SingleFileZ in that it&#x27;s a single static inefficient HTML archive, but it can easily be viewed locally as well?<p>How does it bypass the security restrictions which break SingleFileZ&#x2F;Gwtar in local viewing mode? It&#x27;s complex enough I&#x27;m not following where the trick is and you only mention single-origin with regard to a minor detail (forms).
      • mr_mitm10 hours ago
        The content is in an iframe, my code is outside of it, and the two frames are passing messages back and forth. Also I&#x27;m monkey patching `fetch` and a few other things.
        • gwern9 hours ago
          OK, but how does that get you &#x27;efficiency&#x27; if you&#x27;re doing this weird thing where you serialize the entire page into some JSON blob and pass it in to an iframe or whatever? That would seem to destroy the &#x27;efficiency&#x27; property of the trilemma. How do you get the full set of single-file, static, <i>and</i> efficient, while still working locally?
          • mr_mitm8 hours ago
            I suppose it&#x27;s not efficient in that sense. As I said, the browser has to unpack the whole thing first, so you see a spinner when opening large files. But it&#x27;s inserted into the DOM on demand, so it&#x27;s not overwhelming the browser because it&#x27;s just a blob in memory.
            • gwern8 hours ago
              OK, so your format doesn&#x27;t solve the trilemma; you have &#x27;static&#x27; and &#x27;single-file&#x27;, but not &#x27;efficient&#x27;. Seems like you might as well just go with MHT or SingleFile then...?
  • malkia2 hours ago
    Anyone else - GWAAAR! - G.W.A.R! - I guess the only metal nerd here
  • Retr0id12 hours ago
    It&#x27;s fairly common for archivers (including archive.org) to inject some extra scripts&#x2F;headers into archived pages or otherwise modify the content slightly (e.g. fixing up relative links). If this happens, will it mess up the offsets used for range requests?
    • gwern10 hours ago
      The range requests are to offsets in the original file, so I would <i>think</i> that most cases of &#x27;live&#x27; injection do not necessarily break it. If you download the page and the server injects a bunch of JS into the &#x27;header&#x27; on the fly and the header is now 10,000 bytes longer, then it doesn&#x27;t matter, since all of the ranges and offsets in the original file remain valid: the first JPG is still located starting at offset byte #123,456 in $URL, the second one is located starting at byte #456,789 etc, no matter how much spam got injected into it.<p>Beyond that, depending on how badly the server is tampering with stuff, of course it could break the Gwtar, but then, that is true of any web page whatsoever (never mind archiving), and why they should be very careful when doing so, and generally shouldn&#x27;t.<p>Now you might wonder about &#x27;re-archiving&#x27;: if the IA serves a Gwtar (perhaps archived from Gwern.net), and it injects its header with the metadata and timeline snapshot etc, is this IA Gwtar now broken? If you use a SingleFile-like approach to load it, properly force all references to be static and loaded, and serialize out the final quiescent DOM, then it should not be broken and it should look like you simply archived a normal IA-archived web page. (And then you might turn it back into a Gwtar, just now with a bunch of little additional IA-related snippets.) Also, note that the IA, specifically, does provide endpoints which do not include the wrapper, like APIs or, IIRC, the &#x27;if_&#x2F;&#x27; fragment. (Besides getting a clean copy to mirror, it&#x27;s useful if you&#x27;d like to pop up an IA snapshot in an iframe without the header taking up a lot of space.)
  • iainmerrick9 hours ago
    I agree with the motivation and I really like the idea of a transparent format, but the first example link doesn’t work at all for me in Safari.
  • O1111OOO13 hours ago
    I gave up a long time ago and started using the &quot;Save as...&quot; on browsers again. At the end of the day, I am interested in the actual content and not the look&#x2F;feel of the page.<p>I find it easier to just mass delete assets I don&#x27;t want from the &quot;pageTitle_files&#x2F;&quot; directory (js, images, google-analytics.js, etc).
    • mikae112 hours ago
      Have you <a href="https:&#x2F;&#x2F;addons.mozilla.org&#x2F;firefox&#x2F;addon&#x2F;single-file&#x2F;" rel="nofollow">https:&#x2F;&#x2F;addons.mozilla.org&#x2F;firefox&#x2F;addon&#x2F;single-file&#x2F;</a>?<p>If you really just want the text content you could just save markdown using something like <a href="https:&#x2F;&#x2F;addons.mozilla.org&#x2F;firefox&#x2F;addon&#x2F;llmfeeder&#x2F;" rel="nofollow">https:&#x2F;&#x2F;addons.mozilla.org&#x2F;firefox&#x2F;addon&#x2F;llmfeeder&#x2F;</a>.
      • O1111OOO2 hours ago
        &gt; Have you <a href="https:&#x2F;&#x2F;addons.mozilla.org&#x2F;firefox&#x2F;addon&#x2F;single-file&#x2F;" rel="nofollow">https:&#x2F;&#x2F;addons.mozilla.org&#x2F;firefox&#x2F;addon&#x2F;single-file&#x2F;</a><p>Yes I have. I tried maff, mht, SingleFile and some others over the years. MAFF was actually my goto for many years because it was just a zip container. It felt future-proof for a long time until it wasn&#x27;t (I needed to manually extract contents to view once the supporting extension was gone).<p>I seem to recall that MHT caused me a little more of a conversion problem.<p>It was my concern for future-proofing that eventually led me back to &quot;Save As..&quot;.<p>My first choice is &quot;Save as...&quot; these days because I just want easy long-term access to the content. The content is always the key and picking and choosing which asset to get rid of is fairly easy with this. Sometimes it&#x27;s just all the JS&#x2F;trackers&#x2F;ads, etc..<p>If &quot;Save as...&quot; fails, I&#x27;ll try &#x27;Reader Mode&#x27; and attempt &quot;Save as..&quot; again (this works pretty well on many sites). As a last resort I&#x27;ll use SingleFile (which I like too - I tested it on even DOS browsers from the previous century and it passed my testing).<p>A locally saved SingleFile can be loaded into FF and I can always perform a &quot;Save As...&quot; on it if I wanted to for some reason (eg; smaller file, js-trackers, cleaner HTML, etc).
      • ninalanyon9 hours ago
        On the subject of SingleFile there is also WebScrapBook: <a href="https:&#x2F;&#x2F;github.com&#x2F;danny0838&#x2F;webscrapbook" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;danny0838&#x2F;webscrapbook</a><p>I prefer it because it can save <i>without</i> packing the assets into one HTML file. Then it&#x27;s easy to delete or hardlink common assets.
        • venusenvy478 hours ago
          I see that it gives three choices for saving the assets: single file, zip or folder. Is the zip version just zipping the folder?
    • gwern10 hours ago
      I find that &#x27;save as&#x27; horribly breaks a lot of web pages. There&#x27;s no choice these days but to load pages with JS and serialize out the final quiescent DOM. I also spend a lot of time with uBlock Origin and AlwaysKillSticky and NoScript wrangling my archive snapshots into readability.
    • TiredOfLife11 hours ago
      Save as doesn&#x27;t work on sites that lazy load.
  • spankalee13 hours ago
    I really don&#x27;t understand why a zip file isn&#x27;t a good solution here. Just because is requires &quot;special&quot; zip software on the server?
    • gwern10 hours ago
      &gt; Just because is requires &quot;special&quot; zip software on the server?<p>Yes. A web browser can&#x27;t just read a .zip file as a web page. (Even if a web browser decided to try to download, and decompress, and open a GUI file browser, you still just get a list of files to click.) Therefore, far from satisfying the trilemma, it just doesn&#x27;t work.<p>And if you fix that, you still generally have a choice between either no longer being single-file or efficiency. (You can just serve a split-up HTML from a single ZIP file with some server-side software, which gets you efficiency, but now it&#x27;s no longer single-file; and vice-versa. Because if it&#x27;s a ZIP, how does it stop downloading and only download the parts you need?)
      • spankalee9 hours ago
        We&#x27;re talking about servers here - the article specifically said that one of the requirements was no special _server_ software, and a web server almost certainly has zip (or tar) installed. These gwtar files don&#x27;t work without a server apparently either.
        • gwern8 hours ago
          I&#x27;m not following your point here. Yes, a web server (probably) has access to zip&#x2F;tar utilities, but so what? That doesn&#x27;t automagically make a random .zip jump through hoops to achieve anything beyond &#x27;download like a normal binary asset&#x27;. That&#x27;s what a ZIP file does. Meanwhile, Gwtar works with any server out of the box: it is just a HTML file using a pre-existing HTTP standardized functionality, and works even if the server declines to support range requests for some wacky reason like undocumented Cloudflare bugs, and downgrades RANGE to GET. (It just loses efficiency, but it still works, you know, in the way that a random .zip file doesn&#x27;t work at all as a web page.) You can upload a Gwtar to any HTTP server or similar thing like an AWS bucket and it will at least work, zero configuration or plugins or additional executables or scripting.<p>Now, maybe you mean something like, &#x27;a web server could <i>additionally</i> run some special CGI software or a plugin or do some fancy Lua scripting in order to munge a ZIP and split it up on the fly so as to do something like serve it to clients as a regular efficient multi-file HTML page&#x27;. Sure. I already cover that in the writeup, as we seriously considered this and got as far as writing a Lua nginx script to support special range requests. But then... it&#x27;s not single-file. It&#x27;s multi-file - whatever the <i>additional</i> special config file, script, plugin, or executable is.
    • newzino12 hours ago
      Zip stores its central directory at the end of the file. To find what&#x27;s inside and where each entry starts, you need to read the tail first. That rules out issuing a single Range request to grab one specific asset.<p>Tar is sequential. Each entry header sits right before its data. If the JSON manifest in the Gwtar preamble says an asset lives at byte offset N with size M, the browser fires one Range request and gets exactly those bytes.<p>The other problem is decompression. Zip entries are individually deflate-compressed, so you&#x27;d need a JS inflate library in the self-extracting header. Tar entries are raw bytes, so the header script just slices at known offsets. No decompression code keeps the preamble small.
      • fluidcruft11 hours ago
        You can also read a zip sequentially like a tar file. Some info is in the directory only but just for getting file data you can read the file records sequentially. There are caveats about when files appear multiple times but those caveats also apply to processing tar streams.
  • westurner12 hours ago
    Does this verify and&#x2F;or rewrite the SRI integrity hashes when it inlines resources?<p>Would W3C Web Bundles and HTTP SXG Signed Exchanges solve for this use case?<p>WICG&#x2F;webpackage: <a href="https:&#x2F;&#x2F;github.com&#x2F;WICG&#x2F;webpackage#packaging-tools" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WICG&#x2F;webpackage#packaging-tools</a><p>&quot;Use Cases and Requirements for Web Packages&quot; <a href="https:&#x2F;&#x2F;datatracker.ietf.org&#x2F;doc&#x2F;html&#x2F;draft-yasskin-wpack-use-cases" rel="nofollow">https:&#x2F;&#x2F;datatracker.ietf.org&#x2F;doc&#x2F;html&#x2F;draft-yasskin-wpack-us...</a>
    • gwern10 hours ago
      &gt; Does this verify and&#x2F;or rewrite the SRI integrity hashes when it inlines resources?<p>As far as I know, we do not have any hash verification beyond that built into TCP&#x2F;IP or HTTPS etc. I included SHA hashes just to be safe and forward compatible, but they are not checked.<p>There&#x27;s something of a question here of what hashes are buying you here and what the threat model is. In terms of archiving, we&#x27;re often dealing with half-broken web pages (any of whose contents may themselves be broken) which may have gone through a chain of a dozen owners, where we have no possible web of trust to the original creator, assuming there is even one in any meaningful sense, and where our major failure modes tend to be total file loss or partial corruption somewhere during storage. A random JPG flipping a bit during the HTTPS range request download from the most recent server is in many ways the <i>least</i> of our problems in terms of availability and integrity.<p>This is why I spent a lot more time thinking about how to build FEC in, like with appending PAR2. I&#x27;m vastly more concerned about files being corrupted during storage or the chain of transmission or damaged by a server rewriting stuff, and how to <i>recover</i> from that instead of simply saying &#x27;at least one bit changed somewhere along the way; good luck!&#x27;. If your connection is flaky and a JPEG doesn&#x27;t look right, refresh the page. If the only Gwtar of a page that disappeared 20 years ago is missing half a file because a disk sector went bad in a hobbyist&#x27;s PC 3 mirrors ago, you&#x27;re SOL without FEC. (And even if you can find another good mirror... Where&#x27;s your hash for <i>that</i>?)<p>&gt; Would W3C Web Bundles and HTTP SXG Signed Exchanges solve for this use case?<p>No idea. It sounds like you know more about them than I do. What threat do they protect against, exactly?
  • isr9 hours ago
    Hmm, so this is essentially the appimage concept applied to web pages, namely:<p>- an executable header<p>- which then fuse mounts an embedded read-only heavily compressed filesystem<p>- whose contents are delivered when requested (the entire dwarf&#x2F;squashfs isn&#x27;t uncompressed at once)<p>- allowing you to pack as many of the dependencies as you wish to carry in your archive (so, just like an appimage, any dependency which isn&#x27;t packed can be found &quot;live&quot;<p>- and doesn&#x27;t require any additional, custom infrastructure to run&#x2F;serve<p>Neat!
  • karel-3d10 hours ago
    The example link doesn&#x27;t work for me at all in iOS safari?<p><a href="https:&#x2F;&#x2F;gwern.net&#x2F;doc&#x2F;philosophy&#x2F;religion&#x2F;2010-02-brianmoriarty-thesecretofpsalm46.gwtar.html" rel="nofollow">https:&#x2F;&#x2F;gwern.net&#x2F;doc&#x2F;philosophy&#x2F;religion&#x2F;2010-02-brianmoria...</a><p>I will try on Chrome tomorrow.
    • woodruffw10 hours ago
      It also doesn&#x27;t work on desktop Safari 26.2 (or perhaps it does, but not to the extent intended -- it appears to be trying to download the entire response before any kind of content painting.)
  • renewiltord13 hours ago
    Hmm, I’m interested in this, especially since it applies no compression delta encoding might be feasible for daily scans of the data but for whatever reason my Brave mobile on iOS displays a blank page for the example page. Hmm, perhaps it’s a mobile rendering issue because Chrome and Safari on iOS can’t do it either <a href="https:&#x2F;&#x2F;gwern.net&#x2F;doc&#x2F;philosophy&#x2F;religion&#x2F;2010-02-brianmoriarty-thesecretofpsalm46.gwtar.html" rel="nofollow">https:&#x2F;&#x2F;gwern.net&#x2F;doc&#x2F;philosophy&#x2F;religion&#x2F;2010-02-brianmoria...</a>
  • wetpaws13 hours ago
    [dead]
  • nullsanity13 hours ago
    Gwtar seems like a good solution to a problem nobody seemed to want to fix. However, this website is... something else. It&#x27;s full of inflated self impprtantance, overly bountiful prose, and feels like someone never learned to put in the time to write a shorter essay. Even the about page contains a description of the about page.<p>I don&#x27;t know if anyone else gets &quot;unemployed megalomaniacal lunatic&quot; vibes, but I sure do.
    • 3rodents13 hours ago
      gwern is a legendary blogger (although blogger feels underselling it… “publisher”?) and has earned the right to self-aggrandize about solving a problem he has a vested interest in. Maybe he’s a megalomaniac and&#x2F;or unemployed and&#x2F;or writing too many words but after contributing so much, he has earned it.
      • TimorousBestie12 hours ago
        I was more willing to accept gwern’s eccentricities in the past but as we learn more about MIRI and its questionable funding resources, one wonders how much he’s tied up in it.<p>The Lighthaven retreat in particular was exceptionally shady, possibly even scam-adjacent; I was shocked that he participated in it.
        • k33n11 hours ago
          What does any of that have to do with the value of what’s presented in the article?
    • fluidcruft13 hours ago
      What&#x27;s up with the non-stop knee-jerk bullshit ad hom on HN lately?
      • Krutonium13 hours ago
        We&#x27;re tired, chief.
      • esseph13 hours ago
        The earth is falling out from under a lot of people, and they&#x27;re trying to justify their position on the trash heap as the water level continues to rise around it. It&#x27;s a scary time.
      • TimorousBestie12 hours ago
        Technically it’s only an <i>ad hominem</i> when you’re using the insult as a component in a fallacious argument; the parent comment is merely stating an aesthetic opinion with more force than is typically acceptable here.
        • isr9 hours ago
          I read your BRILLIANT synopsis in the tone of Sir Humphrey (the civil servant) from &quot;Yes Minister&quot;. Fits perfectly. Take a bow, good sir ...
    • isr9 hours ago
      Wow, thats one hell of a reaction to someone&#x27;s blog post introducing their new project.<p>Its almost as if someone charged you $$ for the privilege of reading it, and you now feel scammed, or something?<p>Perhaps you can request a refund. Would that help?