我正在尝试将Service Workers用于我的网站,但我没有使用此技术的经验。是否可以将整个文件夹(例如,包含所有.js / .css的文件夹)添加到this.addEventListener('install', function (event) {
event.waitUntil(
caches.open('v1').then(function (cache) {
return cache.addAll([
'/sw-test/',
'/sw-test/library/4.0/4.0/init.js',
'/sw-test/library/4.0/4.0/esri/css/main.css',
'/sw-test/library/4.0/4.0/dijit/themes/claro/claro.css',
'/sw-test/library/4.0/4.0/',
'/sw-test/index.html',
'/sw-test/app.js',
'/sw-test/styl.css',
'/sw-test/bootstrap.css',
'/sw-test/close.png'
]);
})
);
,而不是像
- hosts: lnx
tasks:
- find: paths="/appl/scripts/inq" recurse=yes patterns="inq.Linux*"
register: file_to_copy
- copy: src={{ item.path }} dest=/usr/local/sbin/
owner: root
mode: 0775
with_items: "{{ files_to_copy.files }}"
...