web: enable `apollo-cache-persist`
Created by: valerybugakov
Context
We have a couple of API queries required for every page in the web application to start: extensionsRegistry
and viewerSettings
. They are quite slow and block the rendering of the app on different stages, which is bad for performance. Because data returned by these API requests don't change frequently we can leverage client-side persistent caching to prevent render-blocking. This PR enables local storage caching via Apollo-Client plugin for three queries: 'viewerSettings', 'extensionRegistry', 'temporarySettings'
. The cached data is still updated in the background: cache-and-network
fetch policy is used. Query names to persist are hardcoded for now. This aspect will be improved in a separate issue: #25035.
Changes
- Enabled apollo-cache-persist for
'viewerSettings', 'extensionRegistry', 'temporarySettings'
.
Timelines
Screenshots from development build. See how cached queries don't delay the execution of subsequent requests.