Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use unversioned frontend asset paths #27091

Merged
merged 6 commits into from
Jul 7, 2021

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Jul 2, 2021

This reverts commit 388edc8.

This builds on top of #25744 where we refactored our JS entry points to be lightweight and to use dynamic imports (via webpack) to load the rest of the JS application.

This PR will now remove the need for the backend to be updated in order to release a new frontend. This will allow us to have frontend-only deploys which should complete much faster than a full deploy. We accomplish this by removing the webpack manifest plugin introduced in #25234, where we previously were versioning b
y a release string in the asset path. These unversioned asset files will be served using a
[Cache-Control: no-cache](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache
-Control#cacheability) header which tells clients that they need to check against the origi
n server to see if the asset has changed, if it has not, they can use their cached copy. Th
ese unversioned files will end up changing quite frequently with every release, but they sh
ould be relatively small. They contain the webpack runtime that allows us to load the rest
of our application bundles, which are versioned by a hash of their contents. These versione
d chunks will have a long-term max-age for caching as the hash in the file name will serv
e to cache bust.

Note: this was reverted in #25994 as it broke p
roduction due to our CDN having cached an old asset due to a cache misconfiguration during
development. This was also not caught in staging because we needed to change the asset path
s for staging deploys to avoid clobbering production assets, and the staging path was not p
reviously cached.

Requires #26987

@billyvg billyvg force-pushed the build/deploy/unversion-frontend-assets branch from 59767dd to 14a9ad2 Compare July 7, 2021 03:15
@billyvg billyvg marked this pull request as ready for review July 7, 2021 20:17
@billyvg billyvg requested review from a team as code owners July 7, 2021 20:17
@billyvg billyvg requested a review from evanpurkhiser July 7, 2021 20:18
@billyvg billyvg merged commit 8b2ff25 into master Jul 7, 2021
@billyvg billyvg deleted the build/deploy/unversion-frontend-assets branch July 7, 2021 22:09
billyvg added a commit that referenced this pull request Jul 14, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants