1- Netlify Build plugin 11ty - A build plugin to integrate Eleventy seamlessly with
2- Netlify.
1+ # Netlify 11ty Build Plugin
32
4- # Install
3+ A build plugin to make building with Eleventy and Netlify a joy!
54
6- Install plugin via npm as dependency
5+ ### Speed up your builds ⚡
6+ - Caches images generated by [ @11ty/eleventy-img ] ( https://github.com/11ty/eleventy-img ) across builds
7+ - Caches assets fetched by [ @11ty/eleventy-cache-assets ] ( https://github.com/11ty/eleventy-cache-assets ) across builds
8+ - Caches any other folders your choice (optional)
9+
10+ ## Install
11+
12+ Install plugin via npm as dependency:
713
814** Note** : Till https://github.com/11ty/eleventy-img/pull/116 is merged,
9- [ this fork] ( https://github.com/zeroby0/eleventy-img/tree/cache ) has to be used instead of ` @11ty/eleventy-img `
15+ please use [ this fork] ( https://github.com/zeroby0/eleventy-img/tree/cache ) instead of ` @11ty/eleventy-img ` .
1016
11- ```
12- npm install zeroby0/netlify-plugin-11ty
17+ ``` bash
1318npm uninstall @11ty/eleventy-img
1419npm install zeroby0/eleventy-img#cache
20+ npm install zeroby0/netlify-plugin-11ty
1521```
1622
17- And add to your ` netlify.toml ` file
23+ And add the plugin to your ` netlify.toml ` file
1824
1925``` toml
2026[[plugins ]]
2127 package = " netlify-plugin-11ty"
2228```
2329
24- # configuration
30+ ## Configuration
2531
26- Optionally, you can configure the plugin to match you project's needs.
32+ Optionally, you can configure the plugin to suit your project's needs.
2733
2834** Example** :
2935
@@ -40,31 +46,33 @@ Optionally, you can configure the plugin to match you project's needs.
4046
4147The following ` inputs ` options are available:
4248
43- #### cache_img
44-
45- Type: ` string ` or ` Array of strings ` Default: ` './img' ` (relative to the publish
46- directory)
49+ ### ` cache_img `
50+ ** Type ** : ` String ` or ` Array of Strings `
51+ ** Default** : ` './img' ` (relative to the publish
52+ directory)
4753
4854The folder(s) in which files generated by ` @11ty/eleventy-img ` are stored,
4955relative to publish directory. Can be a string or an array of strings.
5056
5157If set to ` false ` , files generated by ` @11ty/eleventy-img ` are not saved in
5258Netlify cache.
5359
54- #### cache_img_httpHeader
60+ ### ` cache_img_httpHeader `
5561
56- Type: boolean Default: ` true `
62+ ** Type** : ` Boolean `
63+ ** Default** : ` true `
5764
5865If set to ` true ` , a files generated by ` @11ty/eleventy-img ` will be served with
5966http header ` cache-control: public, max-age=31536000, immutable ` .
6067
6168This should be safe to do as the file names have a hash calculated using file
6269content and Sharp Options.
6370
64- #### cache_assets
71+ ### ` cache_assets `
6572
66- Type: ` string ` or ` Array of strings ` Default: ` '../.cache' ` (relative to the
67- publish directory)
73+ ** Type** : ` String ` or ` Array of Strings `
74+ ** Default** : ` '../.cache' ` (relative to the
75+ publish directory)
6876
6977The folder(s) in which remote assets fetched by ` @11ty/eleventy-cache-assets `
7078are cached, relative to publish directory. Can be a string or an array of
@@ -73,10 +81,33 @@ strings.
7381If set to ` false ` , assets fetched by ` @11ty/eleventy-cache-assets ` are not saved
7482in Netlify cache.
7583
76- #### cache_other
84+ ### ` cache_other `
7785
78- Type: ` string ` or ` Array of strings ` Default: ` [] ` (relative to the publish
79- directory)
86+ ** Type** : ` String ` or ` Array of Strings `
87+ ** Default** : ` [] ` (relative to the publish
88+ directory)
8089
8190Any other folder(s) you'd like to cache across Netlify builds. If these folders
8291exist before restoring Nelify cache, they will be replaced with cached folders.
92+
93+ ## Benchmarks
94+ | Run | No cache persistence | With cache persistence |
95+ | -----------------------| ----------------------| --------------------------|
96+ | 1st run (empty cache) | 11.74 seconds | 11.52 seconds |
97+ | 2nd run (filled cache)| 11.32 seconds | ** 131.82 milliseconds** |
98+
99+ [ Read more] ( https://github.com/11ty/eleventy-img/pull/116#issuecomment-882870369 )
100+
101+ ## Recommended Netlify plugins
102+ - [ Subfont] ( https://github.com/munter/netlify-plugin-subfont )
103+ - [ Inline Critical CSS] ( https://github.com/Tom-Bonnike/netlify-plugin-inline-critical-css#readme )
104+
105+ ## Bugs and Feature Requests
106+
107+ Please [ create an issue] ( https://github.com/zeroby0/netlify-plugin-11ty/issues/new/ ) :)
108+
109+ ## License
110+ MIT
111+
112+ If you need this repository with a different License,
113+ please [ create an issue] ( https://github.com/zeroby0/netlify-plugin-11ty/issues/new/ ) .
0 commit comments