2 ms·
An alternative is to have a minimal HTML that has basically nothing except a <script> tag that connects to a WebSocket then have all content delivered over that
by riskable 4y ago
An alternative is to have a minimal HTML that has basically nothing except a <script> tag that connects to a WebSocket then have all content delivered over that. I've done testing with this in the past and it definitely outperforms HTTP/1.1 but maybe not HTTP/2 or HTTP/3 (never tested against those--this was several years ago).
I even wrote a web server with bundled framework (as an academic exercise) whose whole purpose was to work like this. It was basically made for delivering any given bundles of assets over a WebSocket and had some cool features like the ability to auto-encode, auto-compress, or translate from one file type to another (say, turning a PNG into a JPEG or minifiying JS/CSS) as a simple matter of modifying the configuration.