Skip to content

Commit 5cd4d9a

Browse files
committed
Release 1.0.0
1 parent 01bb615 commit 5cd4d9a

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

Diff for: README.md

+27-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A plugin to make building with Eleventy and Netlify a joy!
55
### Speed up your builds ⚡
66
- Caches images generated by [@11ty/eleventy-img](https://github.com/11ty/eleventy-img) across builds
77
- 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)
8+
- Caches any other folders of your choice (optional)
99

1010
## Install
1111

@@ -52,7 +52,7 @@ The following `inputs` options are available:
5252
directory)
5353

5454
The folder(s) in which files generated by `@11ty/eleventy-img` are stored,
55-
relative to publish directory. Can be a string or an array of strings.
55+
relative to the publish directory. Can be a String or an array of Strings.
5656

5757
If set to `false`, files generated by `@11ty/eleventy-img` are not saved in
5858
Netlify cache.
@@ -65,8 +65,9 @@ Netlify cache.
6565
If set to `true`, a files generated by `@11ty/eleventy-img` will be served with
6666
http header `cache-control: public, max-age=31536000, immutable`.
6767

68-
This should be safe to do as the file names have a hash calculated using file
69-
content and Sharp Options.
68+
Files generated by eleventy_img have a hash calculated using file content and
69+
[Sharp plugin options](https://www.11ty.dev/docs/plugins/image/#advanced-control-of-sharp-image-processor)
70+
in their name, so you can cache them indefinitely.
7071

7172
### `cache_assets`
7273

@@ -75,8 +76,8 @@ content and Sharp Options.
7576
publish directory)
7677

7778
The folder(s) in which remote assets fetched by `@11ty/eleventy-cache-assets`
78-
are cached, relative to publish directory. Can be a string or an array of
79-
strings.
79+
are cached, relative to publish directory. Can be a String or an array of
80+
Strings.
8081

8182
If set to `false`, assets fetched by `@11ty/eleventy-cache-assets` are not saved
8283
in Netlify cache.
@@ -88,26 +89,40 @@ in Netlify cache.
8889
directory)
8990

9091
Any other folder(s) you'd like to cache across Netlify builds. If these folders
91-
exist before restoring Nelify cache, they will be replaced with cached folders.
92+
exist before restoring Nelify cache, their content will be merged and overwritten
93+
with content from the cached folders.
94+
95+
## FAQs
96+
### I `rimraf` my `_site` on every build
97+
98+
If your images are written to `_site/img` (default),
99+
use `rimraf '_site/!(img)'`.
100+
101+
If they are in a subdirectory, say `_site/assets/images`,
102+
use `rimraf '_site/!(assets)' '_site/assets/!(images)'`.
103+
104+
### Are there any Benchmarks?
105+
Yes!
106+
107+
The speed-up, ofcourse, depends on how many images your website has,
108+
but here is a benchmark I used when developing this plugin:
92109

93-
## Benchmarks
94110
| Run | No cache persistence | With cache persistence |
95111
|-----------------------|----------------------|--------------------------|
96112
| 1st run (empty cache) | 11.74 seconds | 11.52 seconds |
97-
| 2nd run (filled cache)| 11.32 seconds | **131.82 milliseconds** |
113+
| 2nd run (filled cache)| 11.32 seconds | 131.82 **milliseconds** |
98114

99115
[Read more](https://github.com/11ty/eleventy-img/pull/116#issuecomment-882870369)
100116

101117
## Recommended Netlify plugins
102118
- [Subfont](https://github.com/munter/netlify-plugin-subfont)
103119
- [Inline Critical CSS](https://github.com/Tom-Bonnike/netlify-plugin-inline-critical-css#readme)
104120

105-
## Bugs and Feature Requests
106-
121+
## Bug Reports, Feature Requests, and Ideas
107122
Please [create an issue](https://github.com/zeroby0/netlify-plugin-11ty/issues/new/) :)
108123

109124
## License
110-
MIT
125+
**MIT**
111126

112127
If you need this repository with a different License,
113128
please [create an issue](https://github.com/zeroby0/netlify-plugin-11ty/issues/new/).

Diff for: package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "netlify-plugin-11ty",
3-
"version": "0.0.4",
3+
"version": "1.0.0",
44
"description": "A plugin to make building with Eleventy and Netlify a joy!",
55
"publishConfig": {
66
"access": "public"

0 commit comments

Comments
 (0)