Clouda Manifest介紹
Clouda框架會將各個package.js中描述的JS和CSS資源自動寫入manifest文件形成離線緩存。 如果對于圖片,音樂等其他文件也有離線緩存需求,可通過建立app.manifest文件進行描述。 在app.manifest中描述過的資源,Clouda框架在啟動時會一并寫入整體manifest文件中。
app.manifest文件應該建立在如下位置,與controller,publish等目錄平級:
app/app.manifest
app.manifest文件的格式與w3c規(guī)定的manifest文件格式一致,見:http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html
注意:目前暫不支持SETTINGS:域
一個示例:
- CACHE MANIFEST
- # the above line is required
- # this is a comment
- # there can be as many of these anywhere in the file
- # they are all ignored
- # comments can have spaces before them
- # but must be alone on the line
- # blank lines are ignored too
- # these are files that need to be cached they can either be listed
- # first, or a "CACHE:" header could be put before them, as is done
- # lower down.
- images/sound-icon.png
- images/background.png
- # note that each file has to be put on its own line
- # here is a file for the online whitelist -- it isn't cached, and
- # references to this file will bypass the cache, always hitting the
- # network (or trying to, if the user is offline).
- NETWORK:
- comm.cgi
- # here is another set of files to cache, this time just the CSS file.
- CACHE:
- style/default.css