SHEET 03blog/the-16kb-curtain/ REVISED 

The 16 KB curtain: why our app never loaded for visitors in Russia

Only 5% of visitors from Russia got past our app's loading screen, against 85-89% from Egypt, Saudi Arabia and the UAE. The cause was a 16 KB limit, not our firewall.

Published
Length
4 min read

A prospect in Russia told us they couldn’t open a form page in our app. The page stayed on its loading screen and never became usable. We don’t block any country, and the firewall logs showed every one of their requests allowed. The cause turned out to be on the network path: Russian ISP filtering freezes connections to some foreign hosting after about 16 KB of data, and our app’s JavaScript is far bigger than that.

What the logs showed

Our app is a single-page app hosted on AWS in Europe. The server sends a small HTML page, then the browser downloads the JavaScript and CSS bundles, then the app starts and calls our API.

For the prospect’s visit, the logs showed:

  • The firewall allowed every request. There are no country rules in our firewall, no CDN in front, and no country checks in the app or the web server.
  • The web server served the HTML, the JavaScript and the CSS.
  • The app made zero API calls.

So the files went out, but the app never started. From the server’s side, nothing failed.

The 16 KB curtain

Russian ISPs run filtering, known as TSPU, that freezes any TCP connection to listed foreign hosting providers once about 16 KB has gone downstream to the user. The providers commonly listed include Cloudflare, Hetzner, DigitalOcean and OVH, and AWS has been named in public reporting too.

That explains the logs. Our HTML page is about 5 KB, so it arrives. The assets that follow are 141 KB, 1 MB and 425 KB. They start downloading, the connection freezes partway, and they never finish. Without its JavaScript the app can’t start, so it never calls the API. The server logs the files as served because, from its side, it sent them.

Measuring it with our own logs

One visitor’s report isn’t proof, so I looked at 60 days of firewall logs, which record each request’s real IP and country. Our web server logs only see the load balancer’s IP, so they couldn’t answer this.

The test was simple. Take every IP that downloaded the JavaScript bundle, and check whether the same IP then called the config endpoint the app hits right after it starts. If the app booted, that call happens.

Country Share of bundle downloads that reached the API
Egypt 85%
Saudi Arabia 87%
UAE 89%
Russia 5% (2 of 38)

In the other three countries, most visitors who downloaded the bundle went on to use the app. In Russia, 2 of 38 did.

I also tried to reproduce it with Globalping, which runs requests from probes in many countries. It couldn’t prove anything either way, because its HTTP checks stop reading the body at 10 KB. That’s below the point where the freeze kicks in, so every probe looked fine.

The fix we didn’t build

The fix we designed was to route visitors from Russia, through DNS, to a relay hosted inside Russia, which passes the encrypted connection through to the load balancer without decrypting it. The connection the filter sees is then to a Russian host.

We didn’t build it, and the reasons aren’t technical. Paying a Russian hosting provider needs legal sign-off. All Russian visitors would also reach the firewall from the relay’s one IP address, which needs its own exception from rate limiting. It’s a business and legal decision first.

A side find: uncompressed JavaScript

Along the way I found that our JavaScript and CSS were being served uncompressed. The web server only compressed HTML. The JavaScript and CSS had shipped uncompressed for months.

We added build-time compression with brotli and gzip for those files. In testing, the main JavaScript bundle went from 1,197 KB to 294 KB with brotli. That’s a real improvement for every visitor, but it doesn’t fix Russia. 294 KB is still far above 16 KB.

The technical notes

If you want to run the same check on your own traffic, AWS WAF logs include the client IP and country for each request. The query has two steps:

  1. Collect the IPs per country that requested your main bundle file.
  2. Of those, count the IPs that later requested an API path the app always calls on startup.

Divide the second count by the first, per country. Use your firewall or CDN logs for this, not the origin server logs, if a load balancer sits in between and hides the client IP.

When you test from probes in other countries, check how much of the response body the tool actually downloads. A tool that stops at 10 KB will report a page as fine even when the files after it never arrive.

What to check if one country can’t use your app

  • Treat “it won’t load from country X” as a network path question first. Check your firewall logs for blocks, and if there are none, look past your own systems.
  • Measure the drop-off between downloading your bundle and the first API call, per country, from your own logs.
  • Make sure your test tools download full files, not just the first few kilobytes.
  • Check that your JavaScript and CSS are compressed. It won’t get you past a 16 KB limit, but uncompressed bundles slow down every visitor.

Questions

Why can't users in Russia load some websites hosted abroad?

Russian ISP filtering has been reported to freeze TCP connections to some foreign hosting providers after about 16 KB of data has been sent to the user. A small HTML page arrives, but larger JavaScript and CSS files never finish downloading.

How do I check whether visitors from one country can use my app?

Use your own logs. Take the visitors from that country who downloaded your app's JavaScript and count how many went on to make their first API call. Compare that share with other countries.

About the author

Software engineer and serial founder in Alexandria, Egypt, and CTO at Zaher.AI, a GEO and SEO agency serving MENA.

Console

Type help and press Enter.