【问题标题】:Html5 cache Manifest not workingHtml5缓存清单不起作用
【发布时间】:2016-01-21 09:25:09
【问题描述】:

我正在尝试让 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。那我需要在哪里添加呢

【问题讨论】:

    标签: html cache-manifest


    【解决方案1】:

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

    AddType text/cache-manifest .appcache
    

    【讨论】:

    • 我需要创建新的 .htaccess 文件吗
    • 如果您已经有 .htaccess 文件,则添加此行,否则创建新的
    • 我将该行添加到 C:\wamp\.htaccess 文件中,但仍然无法正常工作
    • 尝试在应用根目录下添加htaccess文件
    • 仍然无法正常工作。我将 htaccess 文件放在 C:\wamp\www\fullapps 文件夹中,这是我的 index.html 和 12thPayment.txt 文件路径 C:\wamp\www\fullapps\12thdoorApps\PAYMENTS\index.html
    猜你喜欢
    • 2013-10-24
    • 1970-01-01
    • 2012-10-11
    • 2012-02-20
    • 1970-01-01
    • 2010-09-21
    • 2011-01-04
    • 2016-07-04
    • 2011-11-27
    相关资源
    最近更新 更多