[ 
https://issues.apache.org/jira/browse/CB-3071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15402788#comment-15402788
 ] 

David Azevedo commented on CB-3071:
-----------------------------------

Hi guys,

I am having this issue on my app.

Maybe I manage to make it work on the simulator after find this post

http://stackoverflow.com/questions/25853470/shared-nsurlcache-and-uiwebview-on-ios-8
http://inessential.com/2007/02/28/figured_it_the_heck_out

I am using cordova 6.3.0 and cordova ios 4.2.0

Ive tested in ios sim with Ios 8.4 and 9.3 images and its working but tested in 
Iphone 4 Ios 7 Device and didnt worked.
My iphone 5s battery broke so i can test on real iphone 5 that was ios 8.4

I have changed the file: 
[project_name]/app/platforms/ios/[project_name]/Classes/AppDelegate.m

This

- (BOOL)application:(UIApplication*)application 
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    self.viewController = [[MainViewController alloc] init];
    return [super application:application 
didFinishLaunchingWithOptions:launchOptions];
}

To This

- (BOOL)application:(UIApplication*)application 
didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 
* 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
    [NSURLCache setSharedURLCache:URLCache];
    self.viewController = [[MainViewController alloc] init];
    return [super application:application 
didFinishLaunchingWithOptions:launchOptions];
}

But that was just a shot in the Dark, i dont really know what i did so maybe 
you can do better.

Also i made a test with wkwebview-engine (the one that comes with a plugin to 
make local webserver) and there this was working without i change the app 
delegate file

Thank you!

> App cache is invalidated after complete restart of an app
> ---------------------------------------------------------
>
>                 Key: CB-3071
>                 URL: https://issues.apache.org/jira/browse/CB-3071
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.5.0
>            Reporter: Shazron Abdullah
>         Attachments: apache server 200 on GET requests from IOS Cordova 
> client.pdf, apache server 304  on GET requests from cordova client.pdf, 
> headers
>
>
> I have this report from a developer:
> We've recently upgraded from 2.2 to 2.5 on IOS.
> In 2.2, our application leveraged cached assets after a complete restart of 
> the application.  In 2.5 the same scenario always requests new assets from 
> the web server.  The web server has not changed, and it returns caching 
> instructions with the content.  Once the application is running, the cached 
> assets are utilized as we expect.
> Is this by design?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to