From 8129f121c6c86953e889081bb758e41c4d63ca09 Mon Sep 17 00:00:00 2001 From: Yan <61414485+yanthomasdev@users.noreply.github.com> Date: Fri, 18 Sep 2026 11:07:44 -0300 Subject: [PATCH 1/2] Document remote image fetch retries --- src/content/docs/en/reference/modules/astro-assets.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/content/docs/en/reference/modules/astro-assets.mdx b/src/content/docs/en/reference/modules/astro-assets.mdx index 21a41dfcbedb6..089c9d0739639 100644 --- a/src/content/docs/en/reference/modules/astro-assets.mdx +++ b/src/content/docs/en/reference/modules/astro-assets.mdx @@ -297,6 +297,8 @@ import { Image } from 'astro:assets'; As of Astro 5.17.3, `inferSize` only fetches dimensions for [authorized remote image domains](/en/guides/images/#authorizing-remote-images). Remote images outside the allowlist are not fetched. +As of Astro 7.4.0, if fetching the remote image fails because of a transient network error (e.g. a connection reset, DNS lookup failure, or timeout), Astro will automatically retry the request up to two more times before failing. + #### `priority`

@@ -669,13 +671,15 @@ const optimizedBackground = await getImage({src: myBackground, format: 'avif'})

-A function to set the original `width` and `height` of a remote image automatically. This can be used as an alternative to passing the [`inferSize` ](#infersize) property. +A function to set the original `width` and `height` of a remote image automatically. This can be used as an alternative to passing the [`inferSize`](#infersize) property. ```ts import { inferRemoteSize } from 'astro:assets'; const { width, height } = await inferRemoteSize("https://example.com/cat.png"); ``` +As of Astro 7.4.0, `inferRemoteSize()` automatically retries transient network errors in the same way as [`inferSize`](#infersize). + ### `getConfiguredImageService()`

From 14091b0c495e61460674844b9e4cfcb5db99896b Mon Sep 17 00:00:00 2001 From: Yan <61414485+yanthomasdev@users.noreply.github.com> Date: Fri, 18 Sep 2026 12:34:35 -0300 Subject: [PATCH 2/2] Link to inferRemoteSize() in astro:assets --- .../docs/en/reference/modules/astro-assets.mdx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/content/docs/en/reference/modules/astro-assets.mdx b/src/content/docs/en/reference/modules/astro-assets.mdx index 089c9d0739639..b30794574d3ea 100644 --- a/src/content/docs/en/reference/modules/astro-assets.mdx +++ b/src/content/docs/en/reference/modules/astro-assets.mdx @@ -1255,20 +1255,7 @@ const origParams = getOrigQueryParams(url.searchParams);

-Infers the dimensions of a remote image by streaming its data and analyzing it progressively until sufficient metadata is available. - -```ts -import { inferRemoteSize } from 'astro/assets/utils'; - -const remoteImageUrl = 'https://example.com/image.jpg'; -const imageSize = await inferRemoteSize(remoteImageUrl); -// Example value: -// { -// width: 1920, -// height: 1080, -// format: 'jpg' -// } -``` +See [`inferRemoteSize()` in `astro:assets`](#inferremotesize) for more details. ### `propsToFilename()`