Html5缓存清单不起作用

时间:2016-01-21 09:25:09

标签: html5 cache-manifest

我正在努力让HTML5离线存储以基本方式运行。这是我的html文件

<html manifest="12thPayment.appcache" lang="en" ng-app="mainApp">

这是 12thPayment.appcache 文件

CACHE MANIFEST


    https://cdnjs.cloudflare.com/ajax/libs/SVG-Morpheus/0.1.8/svg-morpheus.js  
    https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.8/angular-ui-router.min.js 

    PAYMENTS.html
    ../../js/jquery-2.1.4.min.js
    ../../bower_components/angular/angular.min.js 
    ../../bower_components/angular-animate/angular-animate.js 
    ../../bower_components/angular-aria/angular-aria.js 
    ../../bower_components/angular-material/angular-material.js 
    ../../uimicrokernel/uimicrokernel.js 
    ../../js/directivelibrary.js 
    ../../js/12thdirective.js 
    js/controllers/paymentModule.js 
    js/controllers/configPayment.js 
    js/controllers/paymentService.js 
    js/controllers/paymentAdd.js 
    js/controllers/paymentUpload.js 
    js/controllers/paymentView.js 
    js/controllers/paymentSingleView.js 


    NETWORK:
    *

当我运行文件在线chrome控制台时,表示已创建清单文件,但在离线状态下它无效。我需要添加 text / cache-manifest 。然后我需要在哪里添加它

1 个答案:

答案 0 :(得分:0)

要在Apache服务器上启用AppCache,请将以下内容添加到.htaccess:

AddType text/cache-manifest .appcache