Gwtar: a static efficient single-file HTML format

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Gwtar gives web archivists a way to ship single self-contained HTML files that lazy-load large assets, though it fails when opened locally in a browser.

Read this as

Gwern Branwen and Said Achmiz created 'gwtar', a single HTML file that bundles a whole website plus its media. The file hides a tar archive after a marker, and JavaScript fetches only the pieces a viewer needs. The catch: browser security rules mean it cannot be opened directly from your own computer, you must extract it first with a shell command.

A new single-file HTML archive format from Gwern Branwen and Said Achmiz lets archived web pages embed large media while loading efficiently. Its weakness matters for anyone considering it: opening the file locally shows an error, requiring a perl one-liner and tar to extract content. It suits archive.org-style server hosting, not offline distribution.

Gwtar appends an uncompressed tar archive after an HTML comment marker ('<!-- GWTAR END') and calls window.stop() early to cancel browser fetching of the full payload. Asset URLs are rewritten to https://localhost/ so they fail; a PerformanceObserver with entryTypes ['resource'] captures failed loads, serving blobs from memory or via HTTP range requests into the tar. Requires JavaScript and serving over HTTP, local file:// access is blocked, and noscript users see warnings.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

gwtar Gwern Branwen Said Achmiz Hacker News web.archive.org

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading