roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Add option to use HTTP GET for Actions

Open Ely-S opened this issue 7 months ago • 0 comments

  • Accepted Date:
  • Reference Issues/Discussions: withastro/roadmap#1064
  • Author: @Ely-S
  • Champion(s): @bholmesdev
  • Implementation PR:

Summary

Add support for HTTP GET requests in Astro Actions, enabling browser and CDN caching for data-fetching actions.

Background & Motivation

Astro Actions currently support only POST requests. POST is not cacheable, which means every action call hits the server, even for pure data reads. While it is currently possible to fetch JSON and send query parameters over GET, doing so gives up the type safety, validation, and error handling that Actions provide. Adding GET support would make Actions viable for read-heavy use cases (like search) where CDN caching is necessary.

Goals

  • Allow individual Actions to opt into the GET HTTP method
  • Enable standard HTTP caching to be used for GET Actions
  • Preserve type-safe input validation

Non-Goals

  • Changing the default behavior of POST Actions
  • Supporting request bodies or file uploads in GET Actions
  • Caching and cache management

Ely-S avatar Apr 21 '26 23:04 Ely-S