Improve frontend caching situation #216
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Cache bust JavaScript files so that users don't need to hard refresh their browser when we push updates.
Additionally, adds
build
directory to.dockerignore
. Turns out if you runflutter build web
before runningdocker build
on front-end then the image produced is bugged. Namely, theindex.html
file inside it is not the one produced by flutter, but the defaultindex.html
of nginx. Digging deeper into why this is. I found that our docker image copies the contents of the frontend directory into the image which includesindex.html
ifflutter build web
was already run. Then whenflutter build
runs it removesindex.html
for some reason. So we end up with noindex.html
whatsoever. So when we copy the web build directory into nginx's directory, it doesn't overwrite nginx'sindex.html
. This is a very annoying issue to debug locally. So addingbuild
to.dockerignore
will solve it in the future.Resolved issues
https://warthogs.atlassian.net/browse/RTW-359
Documentation
Web service API changes
Tests
Ran it locally and everything seemed fine.