Skip to content

Make the bundle smaller than 20M #2

@adamziel

Description

@adamziel

The largest files to load for the initial paint are:

  • wp.data – 13M – the WordPress installation and all its php files
  • php-web.wasm – 6.2M – the WebAssembly PHP build
  • wp.js – 182k – the emscripten-generated JS loader for wp.data
  • php-web.js – 153k – the emscripten-generated JS loader for php-web.wasm
  • php-webworker.js – 153k – same as above, but for the webworker backend

Let's shrink them as much as possible.

Here's a few ideas:

  • Minify the variable names in the PHP files
  • Minify the JSON files
  • Remove non-english translations
  • Identify PHP dependencies to remove, e.g. libxml2 doesn't seem necessary
    • libxml2 was removed from the default build in db0a477
  • Compress the .data and .wasm files using brotli compression – props to @eliot-akira. Edit: Web servers take care of it and most browsers support the brotli compression!
  • Consider disabling script/style concatenation #39 – done in Don't include static files in the build. #43 – reduced wp.data from 43M to 13M!
  • Minify the PHP files
  • Remove themes other than twentytwentytwo
  • Remove unminified JS and CSS files
  • Remove the .eot, .gif, .htaccess, .md, .mp4, .png, .scss, .stylelintignore, .svg, .ttf, .txt, .woff, and .woff2 files

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions