惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
美团技术团队
P
Proofpoint News Feed
S
Schneier on Security
P
Privacy International News Feed
Last Week in AI
Last Week in AI
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tor Project blog
S
SegmentFault 最新的问题
Security Latest
Security Latest
月光博客
月光博客
A
About on SuperTechFans
Martin Fowler
Martin Fowler
A
Arctic Wolf
C
Cyber Attacks, Cyber Crime and Cyber Security
腾讯CDC
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
TaoSecurity Blog
TaoSecurity Blog
NISL@THU
NISL@THU
B
Blog RSS Feed
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
V2EX - 技术
V2EX - 技术
Hacker News - Newest:
Hacker News - Newest: "LLM"
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
N
News and Events Feed by Topic
The Last Watchdog
The Last Watchdog
Engineering at Meta
Engineering at Meta
博客园 - 叶小钗
T
Tenable Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LINUX DO - 热门话题
Help Net Security
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog

The Astro Blog

Astro 6.4 Astro 6.3 Starlight 0.39 Astro 6.2 What's new in Astro - April 2026 What's new in Astro - March 2026 Astro 6.1 CloudCannon Joins Astro as an Official CMS Partner Astro 6.0 What's new in Astro - February 2026 What's new in Astro - January 2026 Astro 5.17 Supporting the future of Astro The Astro Technology Company joins Cloudflare Astro 6 Beta What's new in Astro - December 2025 What's new in Astro - November 2025 Astro 5.16 Stainless Sponsors Astro, Launches Astro-Powered Docs Platform What's new in Astro - October 2025 Astro 5.15 Spirit of Astro: meet the winning designs What's new in Astro - September 2025 Astro 5.14 Cloudflare Donates $150,000 to Support Astro's Open Source Mission Webflow Donates $150,000 to Support Astro's Open Source Mission Mux: Our Official Video Partner Unleashing creativity: How CodeTV built a video streaming platform with Astro and Mux | Astro What's new in Astro - August 2025 Astro 5.13 What's new in Astro - July 2025 Astro 5.12 Starlight 0.35 Astro 5.11 What's new in Astro - June 2025 Live Content Collections: A Deep Dive Introducing… Astro Mart Astro Solstice Festival Astro 5.10 Astro 5.9 What's new in Astro - May 2025 Astro 5.8 What's new in Astro - April 2025 2025 Technical Steering Committee Starlight April Update Astro 5.7 Astro Agency Partner Program Astro 5.6 What's new in Astro - March 2025 Astro 5.5 What's new in Astro - February 2025 Starlight 0.32 Astro 5.3 What's new in Astro - January 2025 Astro 5.2 2024 year in review What's new in Astro - December 2024 Astro 5.1 Astro 5.0 Google IDX: Our Official Online Editor Partner What's new in Astro - November 2024 What's new in Astro - October 2024 Astro x Cloudinary SDK What's new in Astro - September 2024 Community Loaders for Astro Content Layer Astro x Hygraph: Content Loader Astro x Cloudinary: Content Loader Astro x Storyblok: Content Loader Content Layer: A Deep Dive Starlight 0.28 Astro 5.0 Beta Release The $100,000 Astro Ecosystem Fund Fall Update Goodbye Studio, Hello DB What's new in Astro - August 2024 Astro 4.15 Astro 4.14 Astro 4.13 What's new in Astro - July 2024 Astro 4.12: Server Islands Netlify: Our Official Deployment Partner What's new in Astro - June 2024 Astro 4.11 Astro Together 2024 Server Islands The Astro Content Layer Zero-JavaScript View Transitions Astro 4.10 Starlight turns one year old! What's new in Astro - May 2024 Astro 4.9 Astro 4.8 What's new in Astro - April 2024 Astro 4.7 Astro 4.6 What's new in Astro - March 2024 Migrating 500+ tests from Mocha to Node.js Astro DB: A Deep Dive The Astro Developer Portal Astro DB Astro 4.5
Astro 5.4
Matt Kane · 2025-02-25 · via The Astro Blog

Astro 5.4 brings remote image optimization in Markdown, enhanced security for dev and preview servers, RegExp support for Vercel ISR excludes, and more!

🖼️ We’ve got a picture-perfect release for you with these improvements to Astro:

  • Remote image optimization in Markdown
  • Experimental responsive image support in Markdown
  • Allowlist hosts for dev and preview servers
  • RegExp support for Vercel ISR excludes
  • New config helpers and build options

To upgrade an existing project, use the automated @astrojs/upgrade CLI tool. Alternatively, upgrade manually by running the upgrade command for your package manager:

# Recommended:

npx @astrojs/upgrade

# Manual:

npm install astro@latest

pnpm upgrade astro --latest

yarn upgrade astro --latest

Remote image optimization in Markdown

Astro’s image service already handled optimizing your local Markdown images. Now, it can do the same for remote images too!

Previously, when you used standard Markdown syntax like ![Houston](https://images.unsplash.com/photo-1530089711124-9ca31fb9e863) with remote images, Astro would simply pass them through without any processing. This was different from how the Image component worked, and meant you couldn’t take advantage of Astro’s image optimization for images stored in a CMS or other external locations.

With Astro 5.4, the image service now automatically processes and optimizes remote images in your Markdown and MDX files too. You’ll get all the benefits of Astro’s image optimization without changing how you write your content.

This feature is enabled by default–any existing remote images in your Markdown and MDX files will automatically be optimized. If you need to opt out for specific images, you can use HTML <img> tags instead of Markdown syntax.

Note that images in your public/ folder are still never processed, following Astro’s normal behavior.

Thanks to PolyWolf for this great contribution!

Experimental responsive image support in Markdown

Previously the experimental responsive images feature only had full support in the Image and Picture components. In Astro 5.4, we’ve extended this support to Markdown and MDX files too!

When using the experimental.responsiveImages option in your Astro config, Astro will now generate responsive images for images in your Markdown and MDX files, applying the correct properties and styles to make them responsive.

Thanks again to PolyWolf who also contributed this feature!

Allowlist hosts for dev and preview servers

For enhanced security, Astro 5.4 introduces a new option to restrict which hostnames your dev and preview servers will respond to.

The new server.allowedHosts configuration option lets you specify a list of allowed hostnames. This will check the Host header of incoming requests and only respond to requests with a matching hostname. This helps prevent DNS rebinding attacks such as GHSA-vg6x-rcgg-rjx6.

You can configure this in your astro.config.mjs:

import {defineConfig} from "astro/config";

export default defineConfig({

server: {

allowedHosts: ['hello.world.example.local', 'hello.example.local']

}

})

Or directly in the CLI:

astro dev --allowed-hosts=hello.world.example.local,hello.example.local

astro preview --allowed-hosts=hello.world.example.local,hello.example.local

You should only use this with domains that you control. Allowing third-party domains can open you up to security risks.

If you need more details about how this works under the hood, check out the Vite documentation, as the implementation is the same.

RegExp support for Vercel ISR excludes

If you’re using Incremental Static Regeneration (ISR) with the Vercel adapter, you now have more flexibility in defining which routes should be excluded from ISR caching.

Previously, you had to explicitly list each route to exclude in the isr.exclude option. For sites with many routes requiring server-side rendering, this could become unwieldy:

import vercel from '@astrojs/vercel';

export default defineConfig({

output: 'server',

adapter: vercel({

isr: {

exclude: [

'/api/users',

'/api/posts',

'/api/comments',

// ... many more API routes

]

}

})

});

Now you can use regular expressions to create powerful, pattern-based exclusions:

import vercel from '@astrojs/vercel';

export default defineConfig({

output: 'server',

adapter: vercel({

isr: {

exclude: [

'/preview', // Specific route

'/auth/[page]', // Dynamic route

/^\/api\/.+/, // RegExp: all routes starting with /api/

]

}

})

});

This makes it much easier to manage ISR exclusions at scale, especially for sites with many API routes or dynamic pages.

Thanks to Slawek Kolodziej for this contribution!

New config helpers and build options

Astro 5.4 introduces new APIs that make it easier to work with Astro programmatically, particularly for testing and scripting scenarios.

Configuration helpers

Two new helper functions are now exported from astro/config:

  • mergeConfig: Allows you to merge partially defined Astro configurations on top of a base config, following the same rules as the updateConfig function available to integrations.
  • validateConfig: Validates that a given value is a valid Astro configuration and fills in default values as needed.

These helpers are particularly useful for integration authors and for developers writing scripts that need to manipulate Astro configurations programmatically.

Programmatic build options

The build API now accepts a second optional BuildOptions argument with two options:

  • devOutput: When set to true, outputs a development-based build similar to code transformed in astro dev. Default is false.
  • teardownCompiler: Controls whether to teardown the compiler WASM instance after build. Default is true.

These options provide more control when running Astro builds programmatically, especially for testing scenarios or custom build pipelines.

Bug fixes

As always, we’ve been working hard on fixing issues since the 5.3 release. See the changelog for all the details.

Thanks

Thanks to everyone who contributed to this release, including Emanuele Stoppa, Luiz Ferraz, Sarah Rainsberger, HiDeoo, Yan Thomas, PolyWolf, Slawek Kolodziej, and many more.

We look forward to seeing what you build with Astro 5.4! If you have questions, comments, or just want to say hi, drop by the Astro Discord.