Skip to content

Commit cdbcf72

Browse files
committed
regenerate docs
1 parent 87fff79 commit cdbcf72

File tree

170 files changed

+2377
-1860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+2377
-1860
lines changed

docs/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**imagetools**[**Docs**](modules.md)
1+
**imagetools**[**Docs**](_media/modules.md)
22

33
# Imagetools documentation
44

@@ -8,13 +8,13 @@ unclear!
88

99
## Basic
1010

11-
- [Why?](guide/why.md)
12-
- [Install](guide/install.md)
13-
- [Getting Started](guide/getting-started.md)
14-
- [All directives](directives.md)
11+
- [Why?](_media/why.md)
12+
- [Install](_media/install.md)
13+
- [Getting Started](_media/getting-started.md)
14+
- [All directives](_media/directives.md)
1515

1616
## Dive deeper
1717

18-
- [Extend Imagetools](guide/extending.md)
18+
- [Extend Imagetools](_media/extending.md)
1919
- [Sharp's documentation](https://sharp.pixelplumbing.com)
20-
- [Caching](guide/caching.md)
20+
- [Caching](_media/caching.md)

docs/_media/caching.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Caching
2+
3+
To speed up a build pipeline with many images, the generated images can be cached on disk.
4+
If the source image changes, the cached images will be regenerated.
5+
6+
## How to configure caching
7+
8+
Caching is enabled by default and uses './node_modules/.cache/imagetools' as the cache directory.
9+
You can disable caching or change the directory with options.
10+
11+
```
12+
// vite.config.js, etc
13+
...
14+
plugins: [
15+
react(),
16+
imagetools({
17+
cache: {
18+
enabled: true,
19+
dir: './node_modules/.cache/imagetools'
20+
}
21+
})
22+
]
23+
...
24+
```
25+
26+
## Cache retention to remove unused images
27+
28+
When an image is no longer there or the transformation parameters change, the previously
29+
cached images will be removed after a configurable retention period.
30+
A value of `undefined` will disable this mechanism, which is the default.
31+
32+
```
33+
// vite.config.js, etc
34+
...
35+
plugins: [
36+
react(),
37+
imagetools({
38+
cache: {
39+
enabled: true,
40+
dir: './node_modules/.cache/imagetools',
41+
retention: 172800
42+
}
43+
})
44+
]
45+
...
46+
```

0 commit comments

Comments
 (0)