Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML 5 Appcache works in safari/opera/chrome but not firefox

I have an html5 appcache running on a website, it works fine in Safari, Opera and Chrome but it fails to work on Firefox.

I have the following in my code:

<!DOCTYPE HTML>
<html manifest="./manifest.appcache">
<head>

and the following manifest.appcache file:

CACHE MANIFEST
/
/accessibility
/anchoring
/areas-of-application-in-business
/calibrating-rep-system-preferences
/circle-of-excellence
/collapse-anchors
/contrastive-analysis-and-mapping-across
/convincers
/creating-an-air-of-authority
/decision-making
/elicitation-of-submodalities
/embedded-commands
/embedded-commands-2
/eye-patterns
/four-types-of-feedback
/home
/how-to-remember-names
/introduction-to-anchoring
/introduction-to-nlp
/key-elements-of-the-meta-model
/language-and-communication-model
/language-patterns
/leadership
/modelling
/my-action-plan
/new-behaviour-generator
/nlp-presuppositions
/outcome-thinking
/pacing-and-leading
/perceptual-positions
/predicate-phrases
/predicates
/preference-test
/presupposition-cards
/presuppositions
/privacy
/rapport
/rapport-pacing-and-leading
/representational-systems
/sensory-acuity
/strategies
/structure-for-adjusting-feedback
/structure-of-nlp-techniques
/structure-vs-content
/submodalities
/submodalities-and-strategies
/submodalities-checklist
/terms-and-conditions
/the-6-deadly-words
/the-meta-mirror
/the-power-of-presuppositions
/the-problem-frame-and-the-outcome-frame
/user-profile
/well-formed-outcomes
/what-is-nlp
/userImages/nlp_language_comm.png
/css/mobile.css
/css/style.css


# Hash: a4e8f4f6a4dd45dd3e8acdaae8546a0a

I am using the code from here: http://jonathanstark.com/blog/2009/09/27/debugging-html-5-offline-application-cache/ to debug the appcache and display the output on the site.

In firefox the output from the debug code shows it downloading all the files and calling swap cache. If I then disconnect from the internet and click on a link to another page which should have downloaded I get the Unable to Connect message in Firefox, while doing the same in Safari, Opera and Chrome it works fine.

Any help and suggestions would be appreciated.

Thanks Steve

like image 321
Steve Jones Avatar asked Sep 16 '11 10:09

Steve Jones


People also ask

How does HTML 5 implement application cache?

Application Cache in HTML5: The current version of HTML5 introduces application cache, which means that a web application is cached, and accessible without an internet connection. Now we can make an offline web application that will run without an internet connection by just creating a manifest file in our application.

What is the purpose of AppCache API in HTML5?

The Application Cache (or AppCache) allows a developer to specify which files the browser should cache and make available to offline users. Your app will load and work correctly, even if the user presses the refresh button while they're offline.

Which event is fired by AppCache?

downloading - The browser has started to download the cache manifest, either for the first time or because changes have been detected. progress - The browser had downloaded and cached an asset. This is fired once for every file that is downloaded (including the current page which is cached implicitly).

What is AppCache API?

The Application Cache (AppCache) API allows offline access to your application by providing the following benefits: Performance - Specified site resources come right from disk, avoiding any network trips. Availability - Users can navigate to your site when they are offline.


2 Answers

Look if the Server sets no-cache/no-store headers for the generated files. Firefox will then ignore the manifest in contrary to the other browsers.

like image 134
Marvin Emil Brach Avatar answered Nov 15 '22 23:11

Marvin Emil Brach


I had a similar problem. The problem was that FireFox cache file more aggressively, so I had to add these headers:

For the manifest:

Pragma: no-cache
Cache-Control: no-cache
Expires: date

And for the files:

Last-Modified: date
Cache-Control: no-cache
Expires: date

Replace date by the RFC 1123 formated current date.

like image 39
JulienFr Avatar answered Nov 16 '22 01:11

JulienFr