# 文件位置:~/blog/_config.yml# offline config passed to sw-precache.service_worker:maximumFileSizeToCacheInBytes:5242880staticFileGlobs:- public/index.html- public/instantclick.js- public/fonts/chinese-zodiac.woff2- public/about/index.html- public/life/*- public/tech/*- public/favicon.ico- public/manifest.jsonstripPrefix:publicverbose:falseruntimeCaching:- urlPattern:/**/*handler:cacheFirstoptions:origin:io-oi.mefilter_optimize:enable:true# remove static resource query string# - like `?v=1.0.0`remove_query_string:true# remove the surrounding comments in each of the bundled filesremove_comments:truecss:enable:true# bundle loaded css file into the onebundle:true# use a script block to load css elements dynamicallydelivery:true# make specific css content inline into the html page# - only support the full path# - default is ['css/main.css']inlines:excludes:js:# bundle loaded js file into the onebundle:trueexcludes:# set the priority of this plugin,# lower means it will be executed first, default is 10priority:12
1)staticFileGlobs 是首次加载时主动缓存的文件,我给出的只适合我的博客,请自行修改。怎么修改呢?hexo g 之后去 ~/blog/public/ 目录下查看生成的文件,需要主动缓存则加上。