WebFormsJS Version Size - Even with a dial-up modem!
Source: Dev.to

Introduction
The WebFormsJS library in WebForms Core by Elanat is a key component for client‑side interactions. As the library evolves, the file size naturally increases. Reducing JavaScript file size is crucial for faster page load times and lower bandwidth usage.
This article examines Minify and Gzip Compression for reducing the size of WebFormsJS across versions 1.0 to 2.0.
Enabling Gzip Response Compression in ASP.NET Core
To reduce the size of transferred files, Gzip Compression can be used. The following ASP.NET Core example shows how to enable Gzip:
// Startup / Program.cs
builder.Services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
options.Providers.Add();
});
builder.Services.Configure(options =>
{
options.Level = System.IO.Compression.CompressionLevel.Fastest;
});
app.UseResponseCompression();
Key points about this setup
Fastestmeans lighter and faster compression, keeping the server responsive.- The technique is universal and can be used with any programming language; ASP.NET Core is shown as a practical example.
WebFormsJS File Sizes Across Versions
File sizes are in kilobytes (KB).
| Version | Raw | Minify | Raw + Gzip | Minify + Gzip |
|---|---|---|---|---|
| 1.0 | 53.01 | 22.57 | 9.25 | 5.69 |
| 1.1 | 60.89 | 26.50 | 10.56 | 6.54 |
| 1.2 | 60.87 | 26.48 | 10.55 | 6.52 |
| 1.3 | 60.68 | 26.30 | 10.52 | 6.49 |
| 1.4 | 74.15 | 31.80 | 12.71 | 7.91 |
| 1.5 | 81.60 | 34.80 | 13.52 | 8.40 |
| 1.6 | 83.68 | 35.36 | 14.13 | 8.71 |
| 1.7 | 92.27 | 39.84 | 16.32 | 10.07 |
| 1.8 | 105.99 | 45.82 | 18.90 | 11.76 |
| 1.9 | 162.50 | 71.96 | 30.10 | 18.41 |
| 2.0 | 319.76 | 145.93 | 62.41 | 39.59 |
A high‑compression test (CompressionLevel.SmallestSize) for version 2.0 produced:
- Raw + Gzip: 48.72 KB
- Minify + Gzip: 33.93 KB
Note: In version 2 of WebForms Core, module‑call support was added, so the library size is expected to stabilize in future releases.
Analysis of Size Reduction
Minify
Removing unnecessary spaces, comments, and formatting reduces the file size by roughly 55–60 % without affecting functionality.
Gzip Compression
Gzip dramatically cuts transfer size; even raw files can see up to 80 % reduction when compressed.
Combining Minify + Gzip
Using both techniques yields the best results:
- Version 1.0: 53 KB → 5.69 KB
- Version 2.0: 319 KB → 39.59 KB
This combination improves page‑load speed and bandwidth efficiency.
Conclusion
Applying Minify and Gzip provides substantial file‑size reductions for any WebFormsJS version.
- In the latest version (2.0), the Minify + Gzip file is only 39.59 KB.
- Such a small payload is extremely efficient even on very slow connections (e.g., a 56 Kbps dial‑up modem loads the script and HTML page in about 6 seconds).
Fastestcompression level maintains high server responsiveness while still delivering impressive size savings.- The technique is language‑agnostic and can be applied in any programming environment; ASP.NET Core is shown here as a practical example.
Combining Minify and Gzip is the most effective approach for optimized file delivery and faster user experience, regardless of connection speed.
