Bobcares

Why HTTP/2 Returns 0 Bytes on IIS 10 Server 2019

PDF Header PDF Footer

Learn why HTTP/2 returns 0 bytes on IIS 10 server 2019. Our Litespeed Support team is here to help you with your questions and concerns.

Why HTTP/2 Returns 0 Bytes on IIS 10 Server 2019

Why HTTP/2 Returns 0 Bytes on IIS 10 Server 2019HTTP/2 is a step above HTTP/1.1 and addresses the latter’s limitations. This modernized protocol improves how HTTP semantics are delivered over TCP connections, offering substantial performance gains.

Furthermore, it is accessible for a broad range of systems, with support for HTTP/2 included in Windows 10 and Windows Server 2016.

Let’s take a closer look at what HTTP/2 brings to the table and explore some of the challenges users might encounter when enabling it on Microsoft IIS.

What is HTTP/2?

HTTP/2 is a complete rework of the HTTP protocol’s underlying transport. The primary improvement over HTTP/1.1 is its ability to handle multiple simultaneous requests over a single persistent connection. While HTTP/1.1 allowed for persistent connections, each request had to wait its turn.

This is known as “head-of-line blocking.” HTTP/2 removes this limitation by introducing multiplexing, which allows multiple data streams to be sent in parallel over the same connection.

Other improvements in HTTP/2 include:

  • Header compression: Reduces overhead by compressing HTTP headers.
  • Stream prioritization: Helps manage the order of responses more efficiently.
  • Binary framing layer: Converts HTTP messages into a binary format for faster processing.

Despite these benefits, enabling HTTP/2 in IIS can lead to unexpected behavior, particularly when server settings or third-party software interfere.

Problem Scenario: Enabling HTTP/2 on IIS

Consider a case where HTTP/2 is enabled in IIS by unchecking the “Disable HTTP/2” option in the port 443 bindings (HTTPS). In this setup, port 80 (HTTP) is disabled, and only secure connections are allowed.

Once HTTP/2 is enabled:

  • Some users may notice that static files served from the IIS compression directory are returned as 0-byte files.
  • This issue only appears when HTTP Static Compression is enabled.
  • Also, requests fail silently or fall back to older behavior without triggering obvious errors.

 

You might also run into issues like authentication errors or limits being exceeded, like the “Maximum Request Length Exceeded” error in IIS“.

The primary cause of this error is antivirus software scanning the IIS compression directory. Also, this scanning process can lock or interfere with temporary files used during compression, resulting in incomplete or corrupted responses.

Additionally, improper group configurations, such as issues with the IIS_IUSRS group, can lead to access-denied problems. Here’s a helpful guide on IIS_IUSRS and permission troubleshooting.

To fix this problem and ensure HTTP/2 functions correctly in our IIS environment, follow these steps:

  • Modify the antivirus settings to exclude the IIS compression directory. The exact method will vary depending on the antivirus software we are using.
  • The default locations for IIS compression directories are:
    • IIS 6.0: `%systemroot%\IIS Temporary Compressed Files`
    • IIS 7.0 and later: `%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files`

    So, to check or modify this path, open IIS Manager, right-click Web Sites, and click Properties. Then, go to the Service tab. Under HTTP Compression, ensure “Compress static files” is enabled, and note the directory path.

  • Additionally, we can use Failed Request Tracing to gain deeper insight into the request/response cycle and identify where problems may exist. This is especially useful for isolating errors like ERR_CONNECTION_REFUSED in IIS and similar HTTP-level issues.

Additional Tips

Even if compression issues are resolved, there are a few more limitations and behaviors to keep in mind when working with HTTP/2 in IIS:

  • Windows Authentication: NTLM, Kerberos, and Negotiate authentication methods are not supported over HTTP/2. In such cases, IIS will automatically fall back to HTTP/1.1.
  • TLS Requirement: IIS only supports HTTP/2 over HTTPS (TLS). Also, if clear text connections are attempted, IIS defaults to HTTP/1.1 again.
  • Bandwidth Throttling: Furthermore, bandwidth limits configured in IIS (via the “Limits” option in site settings) apply only to HTTP/1.1 traffic. HTTP/2 requests ignore these settings.
  • ISAPI Compatibility: If we use custom ISAPI extensions, ensure they’re updated to work with HTTP/2. Also, legacy code that writes headers and bodies using `WriteClient` must be refactored to use `ServerSupportFunction` with the `HSE_REQ_VECTOR_SEND` flag for HTTP/2 compatibility.

If you’re managing complex configurations or migrating settings between servers, it might help to export your IIS configuration using AppCmd to ensure consistency and avoid manual errors.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

HTTP/2 is a great upgrade that improves web application speed and efficiency. However, we must understand the configuration options and potential pitfalls when deploying on IIS.

In brief, our Support Experts demonstrated why HTTP/2 returns 0 bytes on an IIS 10 server in 2019 and how to avoid it.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

server management

Spend time on your business, not on your servers.

TALK TO US

Or click here to learn more.

Speed issues driving customers away?
We’ve got your back!

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF