Offline Web App not caching on Firefox but ok on Chrome [duplicate]

十年热恋 提交于 2019-12-12 02:32:16

问题


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

Hi everyone i was trying to create a offline web app and i Used to be able to do it. But since the last changes when the .appcache extesion was required I am not beeing able to use the manifest file on Firefox. I tested the same file on Chrome and it seems to be running perfect....

Here goes my index.html

<!DOCTYPE html>
<html manifest="manifest.appcache">
<head>
    <meta http-equiv="Content-Language" content="pt-br">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled 1</title>

<script type="text/javascript">


    var cacheStatusValues = [];
    cacheStatusValues[0] = 'uncached';
    cacheStatusValues[1] = 'idle';
    cacheStatusValues[2] = 'checking';
    cacheStatusValues[3] = 'downloading';
    cacheStatusValues[4] = 'updateready';
    cacheStatusValues[5] = 'obsolete';

    var cache = window.applicationCache;

    cache.addEventListener('cached', logEvent, false);
    cache.addEventListener('checking', logEvent, false);
    cache.addEventListener('downloading', logEvent, false);
    cache.addEventListener('error', logEvent, false);
    cache.addEventListener('noupdate', logEvent, false);
    cache.addEventListener('obsolete', logEvent, false);
    cache.addEventListener('progress', logEvent, false);
    cache.addEventListener('updateready', logEvent, false); 

    function logEvent(e) {

        alert("tipo: "+e.type);

     }

     function clica_update(){

        alert("update: "+cache+" - "+cache.status);

        /*
        try{

            cache.update();

        }catch(e){

            alert("erro: "+e);

        }
        */

     };

     alert("FIM");

</script>

</head>

<body>

<p>Teste</p>
<p>&nbsp;</p>
    <p>

<button name="botao" onclick="clica_update();">button</button>

    </p>

</body>
    </html>

And here goes my manifest

CACHE MANIFEST
# rev: 2
*

When I hit the button it says the cache status is equal to 0 (uncached). Does anyone knows what it might be wrong?

By the way does anyone knows any website with a working manifest as i seem to do not find any in the web.

Ps: I checked the about:config on firefox and it seems to be ok...


回答1:


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

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.



来源:https://stackoverflow.com/questions/9467383/offline-web-app-not-caching-on-firefox-but-ok-on-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!