flowkey / UIKit-cross-platform

Cross-platform Swift implementation of UIKit, mostly for Android
MIT License
595 stars 40 forks source link

Implement URLCache on Android #288

Closed mouselangelo closed 4 years ago

mouselangelo commented 5 years ago

Type of change: feature

Motivation (current vs expected behavior)

On iOS URLSession APIs automatically provide default In-memory and on-disk caching via the URLCache API.

The URLCache API has not been implemented in swift-corelibs-foundation - the version of Foundation that our Android build chain uses.

This PR implements a basic URLCache that provides Disk caching for Android.

Todos:

Nice-to-have:

The following are nice to haves and are open for discussion. These can be added later on a need-to basis:

Not doing:

The following are not part of the scope of this PR.

Please check if the PR fulfills these requirements

codecov[bot] commented 5 years ago

Codecov Report

Merging #288 into master will decrease coverage by 1.26%. The diff coverage is 36.8%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #288      +/-   ##
==========================================
- Coverage   51.92%   50.66%   -1.26%     
==========================================
  Files          87       91       +4     
  Lines        3168     3456     +288     
==========================================
+ Hits         1645     1751     +106     
- Misses       1523     1705     +182
Impacted Files Coverage Δ
Sources/TaskRegistry.swift 0% <0%> (ø)
Sources/URLSession+UrlCache.swift 0% <0%> (ø)
Sources/FlowkeyCachedURLResponse.swift 0% <0%> (ø)
Sources/FlowkeyURLCache.swift 74.64% <74.64%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2f5ed04...f243845. Read the comment docs.

mouselangelo commented 4 years ago

Closing this for now, but keeping the branch