Skip to content
Book Open access

In-the-Wild JavaScript Dead-Code Elimination via HTTP Range Requests

Oct 2026 · Proceedings of the 2026 ACM Internet Measurement Conference · 0 citations · 29 references

Abstract

JavaScript (JS) bloat is a major source of slow, data-inefficient web performance, as many sites ship large monolithic bundles with substantial unused code. Existing JS dead-code elimination techniques help but require server-side support and are therefore hard to deploy. This paper evaluates HTTP range requests as a client-side alternative to JS dead code elimination, without requiring server changes beyond standard protocol support. We analyze over 421,000 domains serving JS in the top one million websites and find that roughly two-thirds support even complex multi-range HTTP requests. On a 5,000-page subset analyzed with Google Lighthouse, we estimate that fetching only essential code could reduce JS transfer by about 20%. We then implement ThorJS, a fully client-side technique for JS dead-code removal. It intercepts JS requests and attaches range headers to retrieve only essential code segments of JS resources. Using this prototype, we evaluate system overheads in the browser stack, and application-level performance on 100 representative webpages in the wild. Results show that ThorJS reduces JS transfer by a median of 4 MB, with savings up to 38 MB, and improves page-load time by 13 seconds under slow 3G conditions, with negligible overheads for clients and servers.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.