HTML5 cache manifest no cache for html file itself

前端 未结 3 2314
小蘑菇
小蘑菇 2021-02-14 08:33

index.php:


cache.manifest

CACHE MANIFEST

CACHE:

/img.png
FALLBACK:
/ /offlin         


        
3条回答
  •  花落未央
    2021-02-14 09:09

    I had the same problem.

    I used an iframe to load a page called 'go_offline.html' this page has the manifest attribute on the html element and some dummy content.

    the iframe is hidden using css

    this way only the dummy page is cached and all requests are caught by the fallback page in the .manifest file

提交回复
热议问题