Skip to content

Service worker: cache assets

It caches the following:

  • precompiled assets, including js/css/etc. Cached when service worker is being installed.
  • local emojis (images only, not backend-provided emoji list). this is based on the assumption that once the emoji is added, the image should rarely change later. Cached when the emoji is first requested.

TODOs

  • purge cache in settings
  • if asset cache returns html, should not cache it
  • if asset cache fails on install (happened once while i refreshed the page when i was upgrading pleroma-fe), there is no fallback, and the user will have to purge the cache manually or the page won't load at all
  • [n/a] should cache index.html and use it as a fallback when internet is not available (because drafts can be used offline!) it's indeed cached, just the cache is not used (because chances are the user is not using /index.html to access it). also, when the server is not available, pleroma-fe is not able to keep the logged-in state (it will display as being logged out, and thus make the logged-in-only functionalities unavailable). let's keep this for another mr.
  • load emoji annotations and i18n only as needed
Edited by tusooa

Merge request reports

Loading