Early Abort Plus Range-Based Lazy Retrieval
Sources: 1 • Confidence: High • Updated: 2026-02-19 20:51
Key takeaways
- Gwtar calls window.stop() early and places inline uncompressed tar content after that call to prevent the browser from downloading the entire file up front.
- Gwtar uses a PerformanceObserver configured for resource entries to detect attempted resource loads.
- The suggested local workflow is to extract the embedded tar content using a perl pipeline into tar --extract and then open the resulting HTML file in a browser.
- Gwtar is a project by Gwern Branwen and Said Achmiz intended to combine many assets into a single archived HTML file that remains convenient to view in a browser.
- After stopping the initial load, Gwtar uses HTTP Range requests to fetch required resources on demand from embedded tar data.
Sections
Early Abort Plus Range-Based Lazy Retrieval
- Gwtar calls window.stop() early and places inline uncompressed tar content after that call to prevent the browser from downloading the entire file up front.
- After stopping the initial load, Gwtar uses HTTP Range requests to fetch required resources on demand from embedded tar data.
Browser-Side Interception And Resource Injection
- Gwtar uses a PerformanceObserver configured for resource entries to detect attempted resource loads.
- Gwtar fulfills observed resource requests by locating a previously loaded resource or fetching the needed byte range and injecting it via a blob: URL.
Local File Security Limitation And Extraction Workaround
- The suggested local workflow is to extract the embedded tar content using a perl pipeline into tar --extract and then open the resulting HTML file in a browser.
- Gwtar files cannot be opened locally in a browser due to security restrictions and will display an explanatory message instead of the intended page.
Single-File Html Archiving Objective
- Gwtar is a project by Gwern Branwen and Said Achmiz intended to combine many assets into a single archived HTML file that remains convenient to view in a browser.
Unknowns
- What are the exact browser and hosting requirements for Gwtar to work reliably (for example, which browsers support the necessary observer behavior and which servers/CDNs reliably support the needed Range request behavior for such files)?
- What is the expected performance profile (time-to-first-render, total bytes transferred over a session, memory growth due to blob materialization) across page sizes and asset counts?
- How is the archive produced from an existing multi-asset site (tooling, required transformations, how resource URLs are rewritten, and how tar member offsets are mapped for Range retrieval)?
- What security and policy constraints beyond local file access apply (for example, CSP interactions with blob URLs, cross-origin rules, or restrictions that may vary by browser version)?
- Is there an intended non-extraction offline workflow (for example, running a minimal local HTTP server) that avoids the local file restriction while preserving the single-file container property?