Whenever getConfig is called server-side, it performs a file system lookup, which is expensive. The environment config will not change unless the PWA bundle is redeployed so the config lookup is safe to memoize so that repeated calls do not result in repeated file system lookups.
Types of Changes
[X] Bug fix (non-breaking change that fixes an issue)
[ ] New feature (non-breaking change that adds functionality)
[ ] Documentation update
[ ] Breaking change (could cause existing functionality to not work as expected)
[ ] Other changes (non-breaking changes that does not fit any of the above)
Breaking changes include:
Removing a public function or component or prop
Adding a required argument to a function
Changing the data type of a function parameter or return value
Adding a new peer dependency to package.json
Changes
Memoize getConfig server side
How to Test-Drive This PR
Modify the code so that you call getConfig multiple times serverside.
Check that response times are not negatively impacted.
Checklists
General
[ ] Changes are covered by test cases
[ ] CHANGELOG.md updated with a short description of changes (not required for documentation updates)
Accessibility Compliance
You must check off all items in one of the follow two lists:
[X] There are no changes to UI
or...
[ ] Changes were tested with a Screen Reader (iOS VoiceOver or Android Talkback) and had no issues
Description
Whenever getConfig is called server-side, it performs a file system lookup, which is expensive. The environment config will not change unless the PWA bundle is redeployed so the config lookup is safe to memoize so that repeated calls do not result in repeated file system lookups.
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization