nativescript-community / https

Secure HTTP client with SSL pinning for Nativescript - iOS/Android
https://nativescript-community.github.io/https/
Other
50 stars 42 forks source link

feat: Added support for removing cached responses using url #98

Closed CatchABus closed 1 month ago

CatchABus commented 1 month ago

This PR adds support for removing individual items from cache using the request URL as a key.

The feature is based on recommended native solutions per platform. Android: https://square.github.io/okhttp/features/caching/#pruning-the-cache iOS: https://developer.apple.com/documentation/foundation/nsurlcache/1415377-removecachedresponseforrequest

Note: iOS does not give access to cached items, therefore we create a new NSRequest with the url of the cached resource we want to remove. This solution is suggested by online examples and seems to work.

farfromrefug commented 1 month ago

@CatchABus thanks a lot!