Make your browser game load faster

To make a browser game load faster, serve the build compressed with the matching Content-Encoding header, cache files that don't change under names that change with each build, shrink textures and audio, and show a loading bar while it loads. Then test the hosted link on a phone over mobile data. Browser game file size limits has each host's limits, and Foundplay lists the game for free.

Checked November 23, 2026. Written by Foundplay, a game discovery platform for free browser games.

Copy these to start

For files whose names change with their contents
Cache-Control: public, max-age=31536000, immutable
For the HTML page that loads them
Cache-Control: no-cache

What to change

  • Compression

    What to do
    Serve the build compressed. The browser lists what it accepts in Accept-Encoding, and the server compresses the file and names the method in Content-Encoding: gzip or br (Brotli). Godot's .wasm file shrinks to around a quarter of its size with gzip.
    Watch for
    Compress code and text, not images, audio or video that are compressed already: a second pass usually gains nothing. Godot recommends compressing the .pck and .wasm files most of all, with Brotli where the server supports it.

    Sources: MDN: Compression in HTTP, Godot: Exporting for the Web

    Checked November 23, 2026.

  • Unity builds

    What to do
    Unity compresses release builds with gzip by default, or with Brotli, whose files are smaller but slower to build. Unity's optimization page recommends Brotli.
    Watch for
    The host has to send Content-Encoding: gzip with .gz files and Content-Encoding: br with .br files, and Chrome and Firefox decode Brotli natively only over HTTPS. Decompression Fallback works without the header, with a larger loader and a less efficient load.

    Sources: Unity: Deploy a Web application, Unity: Player settings for a Web build

    Checked November 23, 2026.

  • itch.io

    What to do
    Upload the build as it is: itch.io's CDN gzips html, js, css, svg, wasm, wav, glb and pck files that arrive uncompressed.
    Watch for
    For a file that is gzip compressed already, itch.io sets Content-Encoding: gzip itself. A file whose name ends in .br is served as Brotli, as Unity 2020's WebGL export names them.

    Sources: itch.io: HTML5 games

    Checked November 23, 2026.

  • Caching

    What to do
    Give files that don't change a name that changes with their contents, and a long cache time, as in MDN's Cache-Control: public, max-age=31536000, immutable. Send the HTML page with no-cache so players get each new build.
    Watch for
    In Unity, Name Files As Hashes names each build file by an MD5 hash of its contents, and Data Caching keeps asset data in the browser's IndexedDB, so a return visit downloads only what changed.

    Sources: MDN: HTTP caching, Unity: Web Player settings

    Checked November 23, 2026.

  • Textures and audio

    What to do
    Use images no larger than the game shows, compressed: Unity suggests ASTC textures, ETC2 where ASTC isn't supported, with 8x8 blocks as a start. Compress audio, and turn stereo sounds that don't need it into mono, as Defold suggests.
    Watch for
    Larger ASTC blocks and stronger audio compression cost quality. Defold notes that sounds and graphics usually make up most of a game's size, and its build report shows what does.

    Sources: Unity: Optimize Web for mobile, Defold: Optimizing game size

    Checked November 23, 2026.

  • Engine and code

    What to do
    Leave out engine parts the game doesn't use: Godot suggests an export template built with unused features turned off, Defold suggests removing the physics engines if unused, and Unity suggests Code Optimization set to Disk Size with LTO and Managed Stripping Level set to High.
    Watch for
    Unity's LTO builds can take a long time, so Unity keeps them for the final release. High stripping can change how some reflection code behaves.

    Sources: Godot: Exporting for the Web, Unity: Optimize Web for mobile, Unity: Player settings for a Web build, Defold: Optimizing game size

    Checked November 23, 2026.

  • Load in stages

    What to do
    Download what the first scene needs and fetch the rest later. Unity's Progressive Asset Loading downloads assets scene by scene, and Unity's mobile page suggests Addressables to load assets only when the game needs them.
    Watch for
    In Unity, turning on Progressive Asset Loading turns off Name Files As Hashes and Decompression Fallback.

    Sources: Unity: Player settings for a Web build, Unity: Optimize Web for mobile, Unity: Web Player settings

    Checked November 23, 2026.

  • Loading bar

    What to do
    Show progress while the game loads. Unity's Default web template has a loading bar, GameMaker can swap its default loading bar for one from an extension, and Defold's HTML template gets progress from 0 to 100 through update_progress.
    Watch for
    In GameMaker a splash screen replaces the loading bar: you get one or the other. Its splash should be a .png the size of the game's canvas.

    Sources: GameMaker: HTML5 options, Defold: HTML5, Unity: Web Player settings

    Checked November 23, 2026.

  • Test on a phone

    What to do
    Open the hosted link on a phone over mobile data, in a private window, and throttle the network in your browser's developer tools to try a slow connection.
    Watch for
    Test the live link, not the copy on your computer. Unity notes that phones may download the game over a slow mobile network, and slow loads can lose players.

    Sources: Launch checklist, Unity: Optimize Web for mobile

    Checked November 23, 2026.

Questions

How do I make my HTML5 game load faster?
Serve it compressed with gzip or Brotli and the matching Content-Encoding header, cache files that don't change, use compressed textures and audio, leave out engine parts you don't use, and show a loading bar. Then time it on a phone over mobile data.
Why does my Unity web build need a Content-Encoding header?
Unity compresses release builds into .gz or .br files, and the host has to send Content-Encoding: gzip or br with them. Where you can't set that, Decompression Fallback decodes the files in the page, with a larger loader.
Should I use gzip or Brotli for a web game?
Either. Unity's Brotli files are smaller than gzip but slower to build, and Chrome and Firefox decode Brotli natively only over HTTPS. Unity builds use gzip by default and its optimization page recommends Brotli.
How do I cache my game's files?
Give files that don't change names that change with their contents, send them with a long max-age and immutable, and send the HTML page with no-cache. Cross-origin isolation for browser games shows how three hosts take headers.
How big should my web build be?
As small as you can make it: Unity's mobile page says a smaller build means less data to download and usually shorter load times. Each host's limits are on Browser game file size limits.

More for makers: Browser game file size limits, Make your browser game work on phones, Cross-origin isolation for browser games, Embed a browser game on your site, Where to upload your HTML5 game and Submit a game to Foundplay.