nsurlcache Questions
5
Why does it cache responses. It returns previously fetched responses. It even works if turning off the network connection. Resetting the iOS simulator did not seem to work either. Making a request,...
Tappet asked 19/5, 2015 at 11:30
2
Solved
Does NSURLCache transparently handle ETags received by server?
I mean: does it automatically store ETags for each URL request and then send the appropriate If-None-Match when a request to the same...
Nogas asked 9/2, 2014 at 13:43
5
Solved
I've come across code that looks like this:
NSURLCache *URLCache =
[[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024
diskCapacity:1024 * 1024 * 5
diskPath:nil];
The problem is that I ...
Blether asked 2/7, 2012 at 19:35
3
Solved
Here is the sample function I call when i need to clear cache and make a new call to URL
- (void)clearDataFromNSURLCache:(NSString *)urlString
{
NSURL *requestUrl = [NSURL URLWithString:urlString...
Antemortem asked 8/10, 2014 at 15:11
1
Solved
Just discovered that the function storeCachedResponse(_ cachedResponse: CachedURLResponse, for request: URLRequest) works asynchronously. That is, the result is not returned immediately after execu...
Incident asked 5/12, 2018 at 2:52
3
Solved
Goal
I'm trying to inject data/response from URLRequest into another URLRequest in my cache.
Setup
This is just a sample code. It's ready to be dumped into a project.
What I'm trying to do is ...
Epimorphosis asked 22/10, 2018 at 21:31
1
Solved
I've already asked When exactly do things get removed from urlcache's memory and disk?
Now I have some more follow up questions:
The memory cache is restricted by the iPhone's ram (usually ...
Barbate asked 4/10, 2018 at 16:59
2
Solved
In AppDelegate.m, I configured:
NSURLCache *sharedURLCache = [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024 diskCapacity:100 * 1024 * 1024 diskPath:@"FhtHttpCacheDir"];
Then the htt...
Chambliss asked 10/8, 2018 at 2:39
6
Solved
I set my cache as below
var cacheSizeMemory = 20 * 1024 * 1024
var cacheSizeDisk = 100 * 1024 * 1024
var sharedCache = NSURLCache(memoryCapacity: cacheSizeMemory, diskCapacity: cacheSizeDisk, disk...
Castigate asked 5/1, 2015 at 18:33
1
Solved
let memoryCapacity = 200 * 1024 * 1024
let diskCapacity = 1 * 1024 * 1024
let cache = URLCache(memoryCapacity: memoryCapacity, diskCapacity: diskCapacity, diskPath: "myDataPath")
URLCache.shared = ...
Permalloy asked 8/9, 2017 at 15:52
1
Solved
I am using the code below to set the caching policy of my URLSession via URLConfiguration.
if appDelegateObj.configuration == nil {
appDelegateObj.configuration = URLSessionConfiguration.default
...
Antione asked 17/6, 2017 at 9:34
1
Solved
Does anyone know why this request is being cached?
I'm using an unmodified .default URLSessionConfiguration.
The response headers are:
(from Charles, confirmed from debugging the response in t...
Bryan asked 22/5, 2017 at 21:0
1
I want to encrypt/decrypt all cached data from a NSURLSession using AES256. I'm new using Alamofire but I think it is possible to do it without involving the library itself.
I don't know exactly w...
Tenant asked 26/2, 2017 at 10:52
3
This is the code we had in Swift 2. What is the Swift 3 version? I don't see a replacement for setShared.
let sharedCache: NSURLCache = NSURLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil...
Moguel asked 7/7, 2016 at 15:31
1
My app loads a very big webapp inside a UIWebView.
I have written a NSURLCache extension "LocalCache".
This LocalCache extension intercepts my webapp loading, and serves all requested files from ...
Aaren asked 11/4, 2015 at 3:40
3
Solved
I know NSCache is thread safe, however I can't find out any document mentioned that NSURLCache is thread safe.
Coelho asked 12/2, 2014 at 23:58
3
Solved
Using NSURLSession's default caching, how do I invalidate the cache for a particular URL?
I note NSURLCache's removeCachedResponseForRequest: method, but that takes an NSURLRequest object, which I...
Sleuthhound asked 30/6, 2014 at 14:4
2
Solved
I'm using NSURLSession to request a JSON resource from an HTTP server. The server uses Cache-Control to limit the time the resource is cached on clients.
This works great, but I'd also like to cac...
Hyperspace asked 22/7, 2015 at 0:37
1
I found an issue with (possibly) NSURLCache today while inspecting request and response headers in Charles Proxy. The issue is a little perplexing, but I'm able to repro it consistently:
In a nuts...
Realist asked 18/3, 2015 at 1:52
3
Solved
I have a test app setup and it successfully downloads content from the network even if the user switches apps while a download is in progress. Great, now I have background downloads in place. Now I...
Sculpturesque asked 22/2, 2014 at 16:58
1
Solved
I set NSURLCache on a specific folder (../../Application Support/Offline so it won't be deleted randomly by the OS), then I send a NSURLRequest with NSURLRequestReturnCacheDataElseLoad policy.
How...
Phillada asked 4/2, 2013 at 11:10
1
Solved
I am trying to protect sensitive data stored in NSURLCache. My app's files and Core Data sqlite files are set to NSFileProtectionComplete. However, I am unable to change the NSURLCache files data p...
Speos asked 13/1, 2015 at 23:27
3
I was observirng some strange behaviour of my app sometime caching responses and sometime not caching them (all the responses have Cache-Control: max-age=600).
The test is simple: I did a test.php...
Benzoic asked 27/11, 2013 at 17:6
1
Solved
I'd been using RestKit for the last two years, but recently I've started thinking about transition from these monolith framework as it seems to be really overkill.
Here's my pros for moving forwar...
Pidgin asked 10/4, 2014 at 22:10
1
Solved
In iOS 7, I was able to set a shared URL cache to a subclass of NSURLCache and any UIWebViews I created would automatically use that shared cache for each request.
// Set the URL cache and leave i...
Doublereed asked 15/9, 2014 at 17:23
1 Next >
© 2022 - 2024 — McMap. All rights reserved.