Skip to content

Conversation

@volpeon
Copy link

@volpeon volpeon commented Dec 3, 2025

Fixes #14942

Changes

Sets cache: "no-cache" for the Request object when revalidating remote images. Internal caching mechanisms may change an expected HTTP 304 response to HTTP 200 in an opaque way which causes Astro to reprocess remote images even if it has the latest ones in its cache.

Testing

Manual testing with my personal website. Before vs after:

grafik grafik

Build time is way shorter since images are now used from cache.

Docs

No need to update docs since this simply fixes unexpected behavior.

@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2025

🦋 Changeset detected

Latest commit: 16b475d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Dec 3, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 3, 2025

CodSpeed Performance Report

Merging #14954 will not alter performance

Comparing volpeon:main (16b475d) with main (d9a43e1)1

Summary

✅ 6 untouched

Footnotes

  1. No successful run was found on main (141c676) during the generation of this report, so d9a43e1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image generation: Etag header is ignored

2 participants