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:
...
builder.Services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
options.Providers.Add<GzipCompressionProvider>();
});
builder.Services.Configure<GzipCompressionProviderOptions>(options =>
{
options.Level = System.IO.Compression.CompressionLevel.Fastest;
});
...
app.UseResponseCompression();
...
Key points about this setup:
-
Fastestmeans lighter and faster compression, ensuring the server stays responsive. - This technology is universal and can be used with any programming language; here, ASP.NET Core is shown as a practical example.
WebFormsJS File Sizes Across Versions
File sizes are in KB (kilobytes).
| 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 |
We ran another test in high compression mode (CompressionLevel.SmallestSize) and the results for version 2.0 are as follows:
Raw + Gzip → 48.72 KB
Minify + Gzip → 33.93 KB
Note: It should be noted that in version 2 of the WebForms Core technology, the ability to support module calls has been added, so from now on, the size of the WebFormsJS library will not grow much in future versions, and we will try to keep its size within this range.
Analysis of Size Reduction
Minify
Minifying the files removes unnecessary spaces, comments, and formatting. This reduces the file size by approximately 55–60% without affecting functionality.Gzip Compression
Gzip significantly reduces the transfer size. Even raw files achieve up to 80% reduction when compressed.Combining Minify + Gzip
Using Minify and Gzip together provides the best results. For example:
- Version 1.0: reduced from 53 KB → 5.69 KB
- Version 2.0: reduced from 319 KB → 39.59 KB
This combination improves page load speed and bandwidth efficiency.
Conclusion
Applying Minify and Gzip ensures substantial file size reduction for any version of WebFormsJS.
- In the latest version (2.0), the Minify + Gzip file is only 39.59 KB.
- This small size makes it extremely efficient even on very slow connections, such as a 56 Kbps Dial Up modem. Users experience fast page loads without noticeable delay; even if using a dial-up modem, it takes about 6 seconds to load WebFormsJS and the HTML page.
-
Fastestis chosen to maintain high server responsiveness while still achieving impressive compression. - This technique is language-agnostic and can be applied in any programming environment; ASP.NET Core here serves as a practical example.
- Combining Minify + Gzip is the most effective approach for optimized file delivery and faster user experience, regardless of connection speed.

Top comments (0)