You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "David Azevedo (JIRA)" <ji...@apache.org> on 2016/08/01 20:51:20 UTC

[jira] [Commented] (CB-3071) App cache is invalidated after complete restart of an app

    [ 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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org