Skip to content

Commit 77cf5ae

Browse files
committed
Various fixes, addressed PR comments
1 parent 839b176 commit 77cf5ae

File tree

11 files changed

+19
-21
lines changed

11 files changed

+19
-21
lines changed

docs/cache/external.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Most major CDNs (Cloudflare, Fastly, AWS CloudFront, Akamai, etc.) can cache img
1414

1515
* **Image optimization** - Disable CDN image optimization to avoid double-processing
1616
* **Compression** - In case your CDN supports conditional compression of SVG images, enable gzip/Brotli compression for bandwidth savings
17-
* **Include essential headers*** - It's strongly recommended to include `Accept` header in the cache key. If you have client hints enabled, include also `DPR`, `Sec-CH-Dpr`, and `Sec-CH-Width` headers.
17+
* **Include essential headers*** - Include `Accept` header in the cache key if you're using [format negotiation](../configuration/options.mdx#avifwebpjpeg-xl-support-detection). If you have client hints enabled, include also `DPR`, `Sec-CH-Dpr`, and `Sec-CH-Width` headers.
1818
* **Origin shield** - Add a secondary cache layer between your CDN and imgproxy origin if your CDN supports it.
1919

2020
## nginx caching
@@ -79,7 +79,7 @@ proxy_cache_key "$scheme$proxy_host$request_uri";
7979
proxy_cache_key "$scheme$proxy_host$request_uri$http_accept";
8080
```
8181

82-
3. Include Client Hints dimensions when width/DPR affects output:
82+
3. Include [Client Hints](../configuration/options.mdx#client-hints-support) dimensions when width/DPR affects output:
8383

8484
```nginx
8585
proxy_cache_key "$scheme$request_method$host$request_uri:accept=$http_accept:dpr=$http_dpr:width=$http_width:chdpr=$http_sec_ch_dpr:chwidth=$http_sec_ch_width";
@@ -89,7 +89,7 @@ Use the smallest key that still prevents collisions for your traffic profile.
8989

9090
### Key recommendations
9191

92-
* Include `Accept` in the cache key if format negotiation is used.
92+
* Include `Accept` in the cache key if [format negotiation](../configuration/options.mdx#avifwebpjpeg-xl-support-detection) is used.
9393
* Include DPR/width-related hints in the cache key if [Client Hints](../configuration/options.mdx#client-hints-support) are used to vary output.
9494
* Set long `inactive` timeout (30d) to keep popular images in cache.
9595
* Configure `proxy_cache_use_stale` for graceful degradation during origin issues.
@@ -200,8 +200,8 @@ sub vcl_deliver {
200200
### Key recommendations
201201

202202
* Use `sub vcl_hash` to customize cache key behavior.
203-
* Include `Accept` for format negotiation.
204-
* Include DPR/width-related headers when they can affect output (`DPR`, `Width`, `Sec-CH-DPR`, `Sec-CH-Width`).
203+
* Include `Accept` for [format negotiation](../configuration/options.mdx#avifwebpjpeg-xl-support-detection).
204+
* Include DPR/width-related headers when [Client Hints](../configuration/options.mdx#client-hints-support) support is enabled (`DPR`, `Width`, `Sec-CH-DPR`, `Sec-CH-Width`).
205205
* Set grace period (`beresp.grace`) for graceful error handling.
206206
* Monitor Varnish statistics with `varnishstat`.
207207
* Use tags for efficient cache purging: add `set beresp.http.Surrogate-Key = "images:product:123"` in `vcl_backend_response`.

docs/cache/internal.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ While putting a CDN in front of imgproxy is and will always be a best practice,
1313

1414
## Why use internal cache?
1515

16-
The internal cache provides long-term persistent storage for processed images, unlike CDNs which typically delete rarely accessed content. It stores images in a single location rather than across multiple edge stores, eliminating cache misses when requests hit different edges. The cache is designed specifically for imgproxy, working seamlessly with features like modern image format detection and client hints support that generic external caches don't understand.
16+
The internal cache provides long-term persistent storage for processed images, unlike CDNs, which typically delete rarely accessed content. It stores images in a single location rather than across multiple edge stores, eliminating cache misses when requests hit different edges. The cache is designed specifically for imgproxy, working seamlessly with features like modern image format detection and client hints support that generic external caches don't understand by default.
1717

1818
The cache is protected by the same security measures as imgproxy itself, including URL signatures and processing restrictions. Importantly, URL signatures are not part of the cache key, so you can rotate keys or use multiple key/salt pairs without invalidating cached images. You maintain full control over where the cache is stored and how it integrates with your infrastructure.
1919

docs/cache/internal/amazon_s3.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Learn about how to configure Amazon S3 cache in imgproxy
33
---
44

5-
# Cache storage: Amazon S3
5+
# Internal cache: Amazon S3
66

77
imgproxy can store cached images in Amazon S3 buckets or S3-compatible storage. To use S3 cache, do the following:
88

docs/cache/internal/azure_blob_storage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Learn about how to configure Azure Blob Storage cache in imgproxy
33
---
44

5-
# Cache storage: Azure Blob Storage
5+
# Internal cache: Azure Blob Storage
66

77
imgproxy can store cached images in Azure Blob Storage containers. To use Azure cache, do the following:
88

docs/cache/internal/google_cloud_storage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Learn about how to configure Google Cloud Storage cache in imgproxy
33
---
44

5-
# Cache storage: Google Cloud Storage
5+
# Internal cache: Google Cloud Storage
66

77
imgproxy can store cached images in Google Cloud Storage buckets. To use the GCS cache, do the following:
88

docs/cache/internal/local_filesystem.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Learn about how to configure the local filesystem cache in imgproxy
33
---
44

5-
# Cache storage: Local filesystem
5+
# Internal cache: Local filesystem
66

77
imgproxy can store cached images on the local filesystem. To use filesystem cache, do the following:
88

docs/cache/internal/openstack_swift.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Learn about how to configure OpenStack Object Storage cache in imgproxy
33
---
44

5-
# Cache storage: OpenStack Object Storage ("Swift")
5+
# Internal cache: OpenStack Object Storage ("Swift")
66

77
imgproxy can store cached images in OpenStack Object Storage, also known as Swift. To use Swift cache, do the following:
88

docs/configuration/options.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ echo $(xxd -g 2 -l 64 -p /dev/random | tr -d '\n')
4848
* [`IMGPROXY_PATH_PREFIX`]: the URL path prefix. Example: when set to `/abc/def`, the imgproxy URL will be `/abc/def/%signature/%processing_options/%source_url`. Default: blank
4949
* [`IMGPROXY_USER_AGENT`]: the User-Agent header that will be sent with the source image request. You can use the `%current_version` variable to insert the current imgproxy version. Default: `imgproxy/%current_version`
5050
* [`IMGPROXY_USE_ETAG`]: when set to `true`, enables using the [ETag](https://en.wikipedia.org/wiki/HTTP_ETag) HTTP header for HTTP cache control. Default: `false`
51-
* [`IMGPROXY_ETAG_BUSTER`]: a global ETag buster value. Change this value if you update configuration that affects image processing, to invalidate old ETags and avoid `304 Not Modified` responses from stale client/CDN validators. Default: blank
51+
* [`IMGPROXY_ETAG_BUSTER`]: a global ETag buster value. Change this value if you update the configuration that affects image processing, to invalidate old ETags and avoid `304 Not Modified` responses from stale client/CDN validators. Default: blank
5252
* [`IMGPROXY_USE_LAST_MODIFIED`]: when set to `true`, enables using the [Last-Modified](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified) HTTP header for HTTP cache control. Default: `false`
5353
* [`IMGPROXY_LAST_MODIFIED_BUSTER`]: a global `Last-Modified` buster timestamp in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339.html) format. By setting it to a specific datetime, you can make imgproxy treat all the images as if they were modified at least at that datetime. Default: blank
5454
* [`IMGPROXY_CUSTOM_REQUEST_HEADERS`]: ((pro)) list of custom headers that imgproxy will send while requesting the source image, divided by `\;` (can be redefined by `IMGPROXY_CUSTOM_HEADERS_SEPARATOR`). Example: `X-MyHeader1=Lorem\;X-MyHeader2=Ipsum`
@@ -435,8 +435,8 @@ imgproxy can classify images by assigning them to predefined categories based on
435435
* `full`: normalize to [-1, 1] range
436436
* `imagenet`: normalize using ImageNet mean and standard deviation
437437
* [`IMGPROXY_CLASSIFICATION_LAYOUT`]: ((pro)) the data layout of the neural network input. Possible values are:
438-
* `nchw`: channels first (PyTorch default)
439438
* `nhwc`: _(default)_ channels last (TensorFlow default)
439+
* `nchw`: channels first (PyTorch default)
440440

441441
Read the [Classification guide](../features/classification.mdx) for more info.
442442

@@ -726,7 +726,7 @@ Check out the [CloudWatch](../monitoring/cloud_watch.mdx) guide to learn more.
726726
imgproxy can report occurred errors to Bugsnag, Honeybadger and Sentry:
727727

728728
* [`IMGPROXY_REPORT_DOWNLOADING_ERRORS`]: when `true`, imgproxy will report downloading errors. Default: `true`
729-
* [`IMGPROXY_DEVELOPMENT_ERRORS_MODE`]: when `true`, imgproxy will respond with detailed error messages and stack traces in a pretty HTML format. Useful for development and debugging. Default: `false`
729+
* [`IMGPROXY_DEVELOPMENT_ERRORS_MODE`]: when `true`, imgproxy will respond with detailed error messages and stack traces in a pretty HTML format. Useful for development and debugging. If the client does not `Accept: text/html`, imgproxy reponds with plain text error. Default: `false`
730730

731731
### Bugsnag
732732

docs/features/classification.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,8 @@ You need to define the following config variables to enable object classificatio
596596
Default: `none`
597597

598598
* [`IMGPROXY_CLASSIFICATION_LAYOUT`]: the data layout of the neural network input. Possible values:
599-
* `nchw`: channels first (PyTorch default)
600599
* `nhwc`: channels last (TensorFlow default)
600+
* `nchw`: channels first (PyTorch default)
601601

602602
Default: `nhwc`
603603

@@ -615,7 +615,7 @@ car
615615

616616
## Getting classification info
617617

618-
Object classification is available via the info handler using the `co` (classify objects) endpoint. Fetch classification results by specifying the number of top classes to return:
618+
Object classification is available via the info handler using the `cl` (classify) endpoint. Fetch classification results by specifying the number of top classes to return:
619619

620620
```imgproxy_url
621621
.../info/cl:5/...

docs/image_formats_support.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ The bit depth handling depends on the [IMGPROXY_PRESERVE_HDR](configuration/opti
104104

105105
**When `IMGPROXY_PRESERVE_HDR` is disabled (default):**
106106

107-
* High bit images are converted to 8-bit (eg, GRAYSCALE16 becomes GRAYSCALE8, RGB and scRGB become sRGB)
107+
* High bit images are converted to 8-bit (eg, GRAYSCALE16 becomes GRAYSCALE8, RGB, RGB16 and scRGB become sRGB)
108108
* 8-bit images remain 8-bit

0 commit comments

Comments
 (0)