feat(scheme-handler): Improve memory usage & Range support - #1481
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1481 +/- ##
=======================================
Coverage 80.22% 80.22%
=======================================
Files 16 16
Lines 1871 1871
=======================================
Hits 1501 1501
Misses 370 370 ☔ View full report in Codecov by Sentry. |
dpogue
force-pushed
the
scheme-handler
branch
2 times, most recently
from
August 28, 2024 10:35
b9eab6c to
de4dd9c
Compare
Based on code from ionic-team/cordova-plugin-ionic-webview#692 Closes apacheGH-1033. Co-Authored-By: David Holmgren <dodahoho@users.noreply.github.com>
dpogue
marked this pull request as ready for review
August 29, 2024 02:19
erisu
approved these changes
Aug 29, 2024
erisu
left a comment
Member
There was a problem hiding this comment.
LGTM
Ran a test against a project that overrides scheme, project that contains all Apache Cordova plugins, & the Cordova's sample application.
OS-kepatotorica
pushed a commit
to OutSystems/cordova-ios
that referenced
this pull request
Aug 14, 2025
* refactor(schemes): Read files on a background thread Closes apacheGH-909. * feat(schemes): Support range requests Based on code from ionic-team/cordova-plugin-ionic-webview#692 Closes apacheGH-1033. Co-Authored-By: David Holmgren <dodahoho@users.noreply.github.com> --------- Co-authored-by: David Holmgren <dodahoho@users.noreply.github.com>
sonlichao
added a commit
to dejiren/cordova-ios
that referenced
this pull request
Oct 21, 2025
* refactor(schemes): Read files on a background thread Closes apacheGH-909. * feat(schemes): Support range requests Based on code from ionic-team/cordova-plugin-ionic-webview#692 Closes apacheGH-1033. Co-Authored-By: David Holmgren <dodahoho@users.noreply.github.com> --------- Co-authored-by: David Holmgren <dodahoho@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Platforms affected
iOS
Motivation and Context
Improve memory usage and support range requests for resources loaded via a custom scheme.
Description
Changed the implementation of CDVURLSchemeHandler to do file reading on a background thread in 4MiB chunks rather than trying to load entire files into memory. 4MiB should be sufficient for most HTML/CSS/JS files, while still being low enough to not cause iOS to freak out about memory usage.
Improved URL building for file paths to ensure that things like query strings don't end up affecting which file gets loaded from the filesystem. Closes GH-909.
Also, implement support for the Range header to load subsections of files (mostly used for audio/video files) to further improve memory usage. Closes GH-1033.
Testing
Existing tests pass. All content for the mobile spec testcase loaded properly with these changes.
Checklist