Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14749] iOS: Support HTML5 app cache (using manifest)

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2013-12-11T12:53:11.000+0000
Affected Version/sRelease 3.1.0, Release 3.1.1
Fix Version/sn/a
ComponentsiOS
Labelsmodule_webview, supportTeam
ReporterRupesh Sharma
AssigneeIngo Muschenetz
Created2013-08-02T08:21:42.000+0000
Updated2017-03-21T19:10:41.000+0000

Description

Description

Support for HTML5 app cache (using manifest) for titanium's web view.

Test case

The test case needs a client and a server. Once the files are created, follow these steps: 1) be sure the device is online, then open the app: you would see 2 images in the webview 2) turn off network on the device 3) hit reload in the app: only one image should be shown (the first) as it is the only one cached

Test code

Client side

app.js
var win = Ti.UI.createWindow({
	backgroundColor: 'white'
});

var web = Ti.UI.createWebView({
	url: 'http://example.com/index.html',
	left: 0,
	right: 0,
	top: 0,
	bottom: 100
});

var btn = Ti.UI.createButton({
	title: "Refresh",
	bottom: 0
});

btn.addEventListener('click', function() {
	web.reload();
});

win.add(btn);
win.add(web);
win.open();

Server side

example.manifest
CACHE MANIFEST

v1 - 2011-08-13

http://example.com/index.html http://example.com/image.php
index.html
<html manifest="example.appcache">
<head>
<body>
	<img src="image.php" />
	<img src="imagenocache.php" />
</body>
</html>
image.php and imagenocache.php
<?php
// make sure the file is not cached
header("Content-Type: image/jpg");
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

echo file_get_contents("image.jpg", "r");

Comments

  1. Ingo Muschenetz 2013-08-23

    Does this mean we can close the request if it's working as expected?
  2. Ingo Muschenetz 2013-08-26

    I believe this is already fixed. Please re-open if this is still an issue.
  3. Ingo Muschenetz 2013-12-11

    Should have marked this as invalid as no work was done to "fix" the issue.
  4. Lee Morris 2017-03-21

    Closing ticket as invalid.

JSON Source