phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

Make all resources available offline

Open abose opened this issue 2 years ago • 2 comments

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:

  1. image
  2. image
  3. image
  4. image

Attached log file: phcode.dev-1672817994176.log

abose avatar Jan 04 '23 07:01 abose

  • Mixpanel has native lib: https://developer.mixpanel.com/docs/javascript-quickstart . ether deprecate mixpanel or move to npm managed lib

abose avatar Jan 04 '23 07:01 abose

  • 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.

abose avatar Jan 08 '23 08:01 abose