@11ty/eleventy-cache-assets 中文文档教程
eleventy-cache-assets
需要 Node 10+
获取网络资源并缓存它们,这样你就不会不要轰炸您的 API(或其他资源)。 以可配置的时间间隔执行此操作——而不是每次构建! 每分钟一次,或每小时一次,每天一次,或任何您喜欢的频率!
一个额外的好处是,如果一个成功的请求完成,您现在可以离线工作!
这个插件可以保存任何类型的资产——JSON、HTML、图像、视频等。
The full eleventy-cache-assets
documentation is on 11ty.dev.
- This is a plugin for the Eleventy static site generator.
- Find more Eleventy plugins.
- Please star Eleventy on GitHub, follow @eleven_ty on Twitter, and support 11ty on Open Collective
Installation
npm install @11ty/eleventy-cache-assets
完整的eleventy-cache-assets< /code> 文档在 11ty.dev 上
。
Tests
npm run test
- We use the ava JavaScript test runner (Assertions documentation)
- ℹ️ To keep tests fast, thou shalt try to avoid writing files in tests.
eleventy-cache-assets
Requires Node 10+
Fetch network resources and cache them so you don’t bombard your API (or other resources). Do this at configurable intervals—not with every build! Once per minute, or once per hour, once per day, or however often you like!
With the added benefit that if one successful request completes, you can now work offline!
This plugin can save any kind of asset—JSON, HTML, images, videos, etc.
The full eleventy-cache-assets
documentation is on 11ty.dev.
- This is a plugin for the Eleventy static site generator.
- Find more Eleventy plugins.
- Please star Eleventy on GitHub, follow @eleven_ty on Twitter, and support 11ty on Open Collective
Installation
npm install @11ty/eleventy-cache-assets
The full eleventy-cache-assets
documentation is on 11ty.dev.
Tests
npm run test
- We use the ava JavaScript test runner (Assertions documentation)
- ℹ️ To keep tests fast, thou shalt try to avoid writing files in tests.