Disable network cache right way — Xamarin.iOS

--

A short post about disabling cache for requests by security reasons in iOS.

How to check

var cachePath = Path.Combine(FileSystem.CacheDirectory, AppInfo.PackageName);var files = Directory.GetFiles(cachePath); // can see Cache.db* files

Used Xamarin.Essentials.

How to fix

When you using NSUrlSession, use privacy configuration EphemeralSessionConfiguration:

var session = NSUrlSession.FromConfiguration(
NSUrlSessionConfiguration.EphemeralSessionConfiguration);

End;

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Yauheni Pakala
Yauheni Pakala

Written by Yauheni Pakala

I’m a software engineer. I’m a fan of technology, cross-platform development, and programming.

No responses yet

Write a response