Page MenuHomePhabricator

[Cashtab] Prevent caching of index.html
ClosedPublic

Authored by bytesofman on Jun 8 2022, 18:20.

Details

Reviewers
kieran709
Group Reviewers
Restricted Project
Commits
rABC5c587c4f4855: [Cashtab] Prevent caching of index.html
Summary

T2459

Prevent caching of index.html

This ensures that web app users will always get the most recent version of the app. The JS bundle changes file name with each deployment, so loading the latest index.html will also load the latest js bundle.

Test Plan
cd web/cashtab
docker build -t cashtab_local .
docker run --rm -p 8080:80 --name cashtab cashtab_local

In another terminal,

curl -I http://localhost:8080

Confirm output includes:

Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Pragma: no-cache

Navigate to localhost:8080 and inspect the Network tab in the developer console to get the filename of the js bundle (it probably will not be what I have below, since it changes with every build). Then,

curl -I http://localhost:8080/static/js/main.ca0925d3.js

Confirm output does not include the above cache statements (we want js files to be cached).

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable