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.
Using a CDN for the compiled assets will free up the node server to focus on the tasks it's really needed for. Doing so will speed up the server, reduce server hosting costs, and speed up end user's load times.
Since this added env vars, I figured I'd add a list on configuration env vars to the readme.
Adds:
To use a CDN, set CDN_ASSET_HOST=https://cdn.com
Then upload everything from packages/app/obojobo-express/server/public to the CDN after running
yarn build
for the exact version of the site you deploy.To add further detail:
yarn build
uses webpack, and the assets are named with a name that includes a hash based on the content of the file. Webpack creates a manifest file that is used to look up this hash name - if obojobo is looking for 'fancy-file.js' the manifest is used to look up the built file's namefancy-file-<hash>.js
. Because of this - the files on the CDN need to be updated when the js/css/images are updated because the updated build for obojobo will be looking for a new file by name.This means the deploy process would need to include running yarn build then uploading the public folder to the CDN on every deploy of a new version of the application.