Clouda Manifest介绍

移动开发
Clouda框架会将各个package.js中描述的JS和CSS资源自动写入manifest文件形成离线缓存。 如果对于图片,音乐等其他文件也有离线缓存需求,可通过建立app.manifest文件进行描述。

Clouda框架会将各个package.js中描述的JS和CSS资源自动写入manifest文件形成离线缓存。 如果对于图片,音乐等其他文件也有离线缓存需求,可通过建立app.manifest文件进行描述。 在app.manifest中描述过的资源,Clouda框架在启动时会一并写入整体manifest文件中。

app.manifest文件应该建立在如下位置,与controller,publish等目录平级:

app/app.manifest

app.manifest文件的格式与w3c规定的manifest文件格式一致,见:http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html

注意:目前暂不支持SETTINGS:域

一个示例:

  1. CACHE MANIFEST 
  2. # the above line is required 
  3.  
  4. # this is a comment 
  5. # there can be as many of these anywhere in the file 
  6. # they are all ignored 
  7.   # comments can have spaces before them 
  8.   # but must be alone on the line 
  9.  
  10. # blank lines are ignored too 
  11.  
  12. # these are files that need to be cached they can either be listed 
  13. # first, or a "CACHE:" header could be put before them, as is done 
  14. # lower down. 
  15. images/sound-icon.png 
  16. images/background.png 
  17. # note that each file has to be put on its own line 
  18.  
  19. # here is a file for the online whitelist -- it isn't cached, and 
  20. # references to this file will bypass the cache, always hitting the 
  21. # network (or trying to, if the user is offline). 
  22. NETWORK: 
  23. comm.cgi 
  24.  
  25. # here is another set of files to cache, this time just the CSS file. 
  26. CACHE: 
  27. style/default.css 

 

责任编辑:张叶青
相关推荐

2013-10-30 22:50:30

Clouda结构

2013-10-31 11:04:03

Cloudapackage.js

2014-05-15 09:43:11

CloudaMobile WebANodejs

2013-10-30 22:41:23

Clouda环境

2013-10-31 09:51:10

CLouda结构

2013-10-31 10:59:41

Clouda使用

2013-10-31 22:53:58

Clouda程序

2013-11-04 17:38:09

Clouda百度

2013-10-30 17:34:22

Clouda安装使用

2013-10-28 09:53:26

Clouda杏树林

2013-10-31 14:55:22

2013-10-31 13:47:23

CloudaAPI

2013-10-31 14:30:44

CloudaAPI

2013-10-30 22:10:28

Clouda程序

2013-10-31 15:47:29

CloudaApp

2013-10-31 13:37:07

CloudaAPI手册

2013-08-23 17:12:07

百度WebApp开发框架

2013-10-31 15:27:25

CloudaApp

2013-10-31 15:32:29

CloudaApp

2013-10-31 15:12:57

CloudaAPI
点赞
收藏

51CTO技术栈公众号