0
votes

I'm struggling to get offline files working in Chrome. The first view of the offline page works well, but if I refresh the browser, not so much.

Here's the manifest file (which IS being served as content type "text/cache-manifest"):

CACHE MANIFEST
CACHE:
../CSS/test.css

And here's the HTML for the page that I would like to function offline:

<!DOCTYPE html>
<html manifest="/appname/Resources/manifest.appcache">
<head>
<link rel="stylesheet" href="../CSS/test.css" />
</head>
<body>foo</body>
</html>

When the offline page loads for the FIRST time, I see in the Chrome Developer Tools console that the file in the manifest is loaded into appcache without any errors which is good. However, when I try to refresh the browser, I see an HTTP GET error in the console, and the page doesn't have the styling from test.css applied to it.

What am I doing wrong? If I look at the Resources tab in the developer tools, I see that the manifest file, the html file and the test.css file appear in the appcache. When I refresh, Fiddler shows that the manifest file is being returned with an HTTP code of 304 which I guess would be expected?

Thanks,

Andy

1
Could you give the structure of your app (which files in which directories) ?Jocelyn LECOMTE
appname/Resources/manifest.appcache, appname/CSS/test.css, appname/HTML/test.htmlAndy

1 Answers

0
votes

The fix was to change the reference to the manifest from /appname/Resources/manifest.appcache to ../Resources/manifest.appcache. I don't know why the initial call to the manifest would succeed and subsequent would fail with the former path, but the latter path seems to work.