phoenix
phoenix copied to clipboard
Make all resources available offline
We should make all resources offline for phoenix to work properly on desktop and load fast on browsers. The following errors were seen when phoenix is offline:
Attached log file: phcode.dev-1672817994176.log
- Mixpanel has native lib: https://developer.mixpanel.com/docs/javascript-quickstart . ether deprecate mixpanel or move to npm managed lib
- All google fonts has been removed as part of the above pull request
- All analytics-related scripts are never cached and will fail without causing any issues.
what's left for full offline support
We only cache files we have already encountered via a browser HTTP request. The full files cache is around 50mb, but phoenix at runtime loads fewer than 10 MB to first boot. So we need to defer the large app files download to later.
Available browser technologies
- Chrome, Edge, and chrome on android have a new API for this use case. However, this is not a web standard yet:
- https://developer.chrome.com/blog/background-fetch/
- https://developer.mozilla.org/en-US/docs/Web/API/Background_Fetch_API
- Safari and safari on ios has no immediate replacement
- Firefox also desnt seem to implement a suitable api
- https://developer.chrome.com/blog/background-sync/ is another available technology though not sure if it is suitable for this usecase.