feat(live-update): support .br ZIP artifacts on Android#800
feat(live-update): support .br ZIP artifacts on Android#800mustafa0x wants to merge 3 commits intocapawesome-team:mainfrom
Conversation
|
@mustafa0x Thank you for your PR! Please create two separate PRs, as these fixes are unrelated to each other. For the |
|
Thanks @robingenz! I simplified. |
19e1680 to
38bce36
Compare
|
@mustafa0x Thank you! How did you test it? |
@capawesome/capacitor-age-signals
@capawesome-team/capacitor-android-battery-optimization
@capawesome/capacitor-android-dark-mode-support
@capawesome/capacitor-android-edge-to-edge-support
@capawesome-team/capacitor-android-foreground-service
@capawesome/capacitor-app-review
@capawesome/capacitor-app-shortcuts
@capawesome/capacitor-app-update
@capawesome/capacitor-apple-sign-in
@capawesome/capacitor-asset-manager
@capawesome/capacitor-background-task
@capawesome/capacitor-badge
@capawesome/capacitor-cloudinary
@capawesome-team/capacitor-datetime-picker
@capawesome-team/capacitor-file-opener
@capawesome/capacitor-file-picker
@capawesome/capacitor-google-sign-in
@capawesome/capacitor-libsql
@capawesome/capacitor-live-update
@capawesome/capacitor-managed-configurations
@capawesome/capacitor-photo-editor
@capawesome/capacitor-posthog
@capawesome/capacitor-realtimekit
@capawesome/capacitor-screen-orientation
@capawesome/capacitor-screenshot
@capawesome/capacitor-square-mobile-payments
@capawesome/capacitor-superwall
@capawesome/capacitor-torch
commit: |
|
running tests in the sim now |
|
@mustafa0x Cloudflare should automatically compress all outgoing files using Brotli if the client supports it. So, as far as I know, the |
It doesn't. It uses zstd. Which is good, but not nearly as small. I recently opened an issue with CF noting this: https://community.cloudflare.com/t/cloudlfare-recompresses-brotli-as-zstd-doubling-size/896014 You can test this with curl -I (I don't use capawesome cloud) And even if CF does compress via brotli, precompressed at the highest level does much better. Again, it's easy to test this. If you point me to a test url I'll investigate myself and give you concrete numbers. |
|
I do advise supporting brotli :) "Brotli compression saves 1.5 petabytes per day at Google’s Play Store" |
|
It would be great if you could give it a try using Capawesome Cloud. The free plan includes live updates. Just upload a bundle using the Capawesome CLI and then compare the download speed of the bundles. Otherwise, I’ll give it a try myself in the next few days and also check how much effort it would be to support the EDIT: What about iOS? |
Summary
.brfiles.br, download it and decompress to a temporary ZIP before extractionTests Run
Android plugin verification
ANDROID_HOME="$HOME/Library/Android/sdk" ANDROID_SDK_ROOT="$HOME/Library/Android/sdk" GRADLE_OPTS="-Dhttps.protocols=TLSv1.2,TLSv1.3 -Djdk.tls.client.protocols=TLSv1.2,TLSv1.3" mise x java@openjdk-21.0.2 -- npm run verify:androidRuntime test for Brotli HTTP response support (
Content-Encoding: br)http://10.0.2.2:8787/bundle.zipwithContent-Type: application/zipandContent-Encoding: brLiveUpdate.downloadBundle({ artifactType: 'zip', bundleId: 'br-test', url: 'http://10.0.2.2:8787/bundle.zip' })Runtime test for actual
.brartifact support (noContent-Encoding)http://10.0.2.2:8787/bundle.brwithContent-Type: application/octet-streamand noContent-EncodingheaderLiveUpdate.downloadBundle({ artifactType: 'zip', bundleId: 'br-raw-test', url: 'http://10.0.2.2:8787/bundle.br' })downloadBundleresolved successfullygetDownloadedBundles()includedbr-raw-testGET /bundle.br