Mantano / iridium

Unofficial Dart/Flutter port of some of the Readium 2 components
77 stars 27 forks source link

[server] Remove the HTTP server (like in Bookari) #42

Open jmgeffroy opened 2 years ago

jmgeffroy commented 2 years ago

Removing the HTTP server has a lot of positive consequences:

This performance boost can easily be perceived when navigating with the ToC or progressbar in a book which contains its own fonts, or many image assets. In this area:

For Iridium, we don't need to take care of Android <= 6, but we'll maintain the ability to start the HTTP server for different usages, such as client-server deployments (some adaptations will be required for his use-case but are worth investigating).

Thanks to the migration to Flutter InAppWebView, we have everything we need: https://pub.dev/documentation/flutter_inappwebview/latest/flutter_inappwebview/WebView/onLoadResourceCustomScheme.html

onLoadResourceCustomScheme is an InAppWebView cross-platform option, so it should be OK on both Android and iOS...

Note: See in Bookari (Mantano private repo)

See also:

jmgeffroy commented 2 years ago

First tests are disappointing from a performance point of view. The reason is that "you shouldn't do any heavy processing inside shouldInterceptRequest, as it is a synchronous call (albeit on another thread). Calls for all network requests are processed on the same thread so blocking for one request will cause all of the other requests to be blocked as well" (source). So we should spawn isolates.

jmgeffroy commented 2 years ago

Putting this on hold, and implementing isolates in the server version

westernbuptboy commented 1 year ago

note and bookmark not work on Android 6 because paginationInfo and currentSpineItemContext is null. related to this issue?

gwangbaekun commented 3 months ago

Yes. related. Bloc doesn't add data anymore. You should manually set paginationInfo with the position.