boxine / chunk-tester

Monitor availability chunks of a Single-Page Application across a CDN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chunk tester

A Single Page Application (SPA) serves the same (or very similar) HTML for all URLs. The served HTML is just a very minimal page without content, and references JavaScript files.

For performance reasons, the whole JavaScript code of an SPA is usually split into multiple chunks. Upon load, only the minimum necessary chunks are loaded. When the user navigates to a page or view which requires additional chunks, these chunks are loaded only then.

This speeds up initial load times, but introduces a different problem: When a new version of the SPA is deployed, users who had the old information about chunks will load older chunks. This requires that older chunks are still served after a deployment.

This tool performs a long-running test, checking each CDN IP address every minute, and logging:

  1. Which HTML is served by this CDN edge node? Ideally, we would want Edge nodes to serve new HTML pages immediately; after a deployment is done, all new customers should see the new site.
  2. Which JavaScript files referenced in the current or previous versions is available? Just like HTML updates, we would always expect the current JavaScript to be available, but also previous versions.

About

Monitor availability chunks of a Single-Page Application across a CDN


Languages

Language:JavaScript 63.2%Language:HTML 34.7%Language:CSS 1.3%Language:Dockerfile 0.6%Language:Makefile 0.1%Language:Shell 0.1%