My HTML5 Application Cache Manifest is caching everything

前端 未结 3 645
伪装坚强ぢ
伪装坚强ぢ 2020-11-28 05:03

UPDATE:

** I posted this question when this feature was really new, I realize now that this feature should not be used this way unless it is used vi

相关标签:
3条回答
  • 2020-11-28 05:28

    The appcache always contains the page that contains the manifest attribute in the html tag.

    If you want that page itself to be dynamic, you must load content into it with an ajax call to a service that is in the NETWORK section.

    0 讨论(0)
  • 2020-11-28 05:30

    I guess the Iframe-workaround doesn't work. If you think the files are loaeded from appcache: no. they're coming from browser cache.

    disable browsercache in devtools-settings und look at "network". you can see, that all elements will be loaded via network and don't come frome (app)cache.

    0 讨论(0)
  • 2020-11-28 05:38

    Here is a hack I found out by playing around:

    I haven't found the ultimate answer but from what I've learned it seems that the manifest is not meant to be set on every page. Again I'm not sure but this is a hack that I came across. I have a page such as manifest.html that has the

    <html manifest="manifest.appcache"> 
    

    I learned that pages which do not have this will not be added to the cache however they will still continue using the application cache if on the same domain. Therfore if you include manifest.html a plain html page that has this in an iframe on everypage it will not cache that page like chrome will no longer output:

    Adding master entry to Application Cache with manifest 
    

    but if you go to network tab you will see that it is using the cache

    <iframe id='manifest_iframe_hack' 
      style='display: none;' 
      src='temporary_manifest_hack.html'>
    </iframe> 
    

    content of temporary_manifest_hack.html:

    <!DOCTYPE HTML>
    <html lang="en" class="no-js" manifest="manifest.appcache">
        <head>
            <meta charset="utf-8">
            <title>Hack 4 Manifest</title>
        </head>
        <body></body>
    </html>
    
    0 讨论(0)
提交回复
热议问题