Questo sito potrebbe offrire funzionalità limitate durante le operazioni di manutenzione per migliorare l'esperienza utente. Se un articolo non risolve il tuo problema e vuoi richiedere supporto, la nostra comunità di supporto è pronta ad aiutarti tramite @FirefoxSupport su Twitter e /r/firefox su Reddit.

Cerca nel supporto

Attenzione alle mail truffa. Mozilla non chiederà mai di chiamare o mandare messaggi a un numero di telefono o di inviare dati personali. Segnalare qualsiasi attività sospetta utilizzando l'opzione “Segnala abuso”.

Ulteriori informazioni

Questa discussione è archiviata. Inserire una nuova richiesta se occorre aiuto.

window.applicationCache.status never only returns 0 or 1

  • 3 risposte
  • 4 hanno questo problema
  • 2 visualizzazioni
  • Ultima risposta di bkauffman

more options

I have am using a manifest file to cache pages for a web app. By changing the version # in my manifest file updates are then pushed to apps in Chrome, Safari, and IE....but not in Firefox. I got this chunk of code directly from a Mozilla forum:

  function onUpdateReady(){
   window.applicationCache.swapCache();
  }
  window.applicationCache.addEventListener('updateready', onUpdateReady);
  if(window.applicationCache.status === window.applicationCache.UPDATEREADY){
   onUpdateReady();
  }

I used jQuery to alert window.applicationCache.status, which in Firefox only returns either 0 or 1....never 4 as it should when a change to the manifest file has been made. Am I missing something, or is this a bug?

 I should mention that this is what my .htaccess file looks like:
AddType text/cache-manifest .manifest
ExpiresActive On

<Files index.html>
Header append Cache-Control "public, must-revalidate"
</Files>
I have am using a manifest file to cache pages for a web app. By changing the version # in my manifest file updates are then pushed to apps in Chrome, Safari, and IE....but not in Firefox. I got this chunk of code directly from a Mozilla forum: <pre><nowiki> function onUpdateReady(){ window.applicationCache.swapCache(); } window.applicationCache.addEventListener('updateready', onUpdateReady); if(window.applicationCache.status === window.applicationCache.UPDATEREADY){ onUpdateReady(); } </nowiki></pre> I used jQuery to alert window.applicationCache.status, which in Firefox only returns either 0 or 1....never 4 as it should when a change to the manifest file has been made. Am I missing something, or is this a bug? I should mention that this is what my .htaccess file looks like: <pre><nowiki>AddType text/cache-manifest .manifest ExpiresActive On <Files index.html> Header append Cache-Control "public, must-revalidate" </Files></nowiki></pre>

Modificato da cor-el il

Tutte le risposte (3)

more options

It does not look like it: https://developer.mozilla.org/en-US/d.../Using_the_application_cache

  • Does is have MIME type text/cache-manifest.
  • Is the .htacess file within either the root directory, or the same directory as the application.
  • In the .appache file, do you have a ExpiresByType text/cache-manifest "access plus 0 seconds"

Another reference I found: https://developer.mozilla.org/en-US/d.../Application_cache_implementation_overview#Updating_an_existing_cache_or_first_download_of_an_offline_cache

If it is not working as expected, definately file a bug in [bugzilla.mozilla.org]

more options

See also [/questions/993853] (locked)

more options

1. My .htaccess file has: AddType text/cache-manifest .manifest 2. The .htaccess file is in the root. 3. Per your suggestion I added: ExpiresByType text/cache-manifest "access plus 0 seconds"...still nothing. Updates to the .manifest file are noticed in Chrome, Safari, and IE....but still not in Firefox.

 Using the error console I get this message: "Offline cache doesn't need to update". All my files are getting cached, and the site works as it should in off-line mode...Firefox just isn't seeing changes that I make to my .manifest file.

Modificato da bkauffman il