Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7728] iOS: createHTTPClient shoud have a new parameter to enable/disable the cache.

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2012-02-21T16:02:57.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterHenri-Maxime Ducoulombier
AssigneeNeeraj Gupta
Created2012-02-03T01:05:16.000+0000
Updated2017-03-22T21:24:38.000+0000

Description

Since SDK 1.8, the ASIDownloadCache has been implemented in the TiNetworkHTTPClientProxy developer isn't able to enable/disable it at will. I use the XHR object to download a lot of files (hundreds, sometimes thousands) to enable photo album browsing offline, and when the app restarts, it hangs at the first xhr.open() method call because of ASIDownloadCache background task. The cache is absolutly useless for massive different files download, and developers should be able to decide whether they want to use it or not. So I believe that : (In TiNetworkHTTPClientProxy.m) : request = [[ASIFormDataRequest requestWithURL:url] retain]; [request setDownloadCache:[ASIDownloadCache sharedCache]]; [request setDelegate:self]; Should be something like this : request = [[ASIFormDataRequest requestWithURL:url] retain]; if (useCache){ [request setDownloadCache:[ASIDownloadCache sharedCache]]; } [request setDelegate:self]; I tried editing the SDK myself, adding the useCache parameter : Ti.Network.createHTTPClient({ timeout:5000, useCache:true }); But this won't work (it will disable the cache all the time, I'm not able to enable it back again). Link to my original Q&A post : http://developer.appcelerator.com/question/131438/application-hangs-at-startup-at-first-tinetwork-use-attempt

Comments

  1. Henri-Maxime Ducoulombier 2012-02-03

    I was able to make the changes myself and I'm going to make a pull request to the official github repository.
  2. Henri-Maxime Ducoulombier 2012-02-03

    Pull request made.
  3. Henri-Maxime Ducoulombier 2012-02-07

    BTW, this issue should me moved to TIMOB. It seems I made a mistake when selecting where the issue should be...
  4. Stephen Tramer 2012-02-21

    Dupe of TIMOB-7605
  5. Lee Morris 2017-03-22

    Closing as duplicate with regards to the information provided elsewhere in this ticket.

JSON Source