

The problem: URL length and intermediaries
A few query parameters are fine. But as filter sets grow (more fields, lists, nested structures), the URL gets longer. Even if the origin server accepts long URLs, intermediaries in the request path—load balancers, CDNs, reverse proxies, or WAFs—often enforce their own limits and can reject requests with long URLs. For example, AWS CloudFront documents URL size limits of roughly 8 KB; other components may use different thresholds. See AWS CloudFront limits for details: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/limits.html A long search URL can therefore be rejected before it reaches the origin:Why not put filters in a GET body?
Moving filters into the request body avoids URL-length limits, but GET bodies are not reliably supported across the ecosystem:- GET was designed around the URL; servers and intermediaries vary in how they treat GET bodies.
- Some proxies, CDNs, or frameworks ignore the body or treat the request unpredictably.
- Certain intermediaries may strip or reject GET requests that include a body.
Why not use POST?
POST reliably carries a body, but it introduces other trade-offs:- POST is commonly associated with operations that change state (create/update). Because of that, caches and CDNs often treat POST as non-cacheable or apply conservative rules.
- Caches are less likely to reuse responses to POST requests, making search traffic hit the origin unnecessarily.
- POST is not guaranteed to be idempotent. Retries of POST may cause unintended side effects (e.g., duplicate orders) unless the server provides deduplication.
Introducing QUERY: a body-friendly, safe, idempotent read method
QUERY is proposed to fill the gap: it carries structured or large read-only input in the request body while clearly declaring the intent that the request is safe (read-only) and idempotent. With that signal, intermediaries that understand QUERY could:- Treat QUERY as cacheable (when configured to do so),
- Use the request body as part of the cache key for identical filter bodies,
- Allow safe client retries without fear of server-side side effects.
Quick comparison: GET vs POST vs QUERY
Benefits of QUERY
- Allows long/structured filter payloads in the request body without relying on the URL.
- Enables caches and CDNs that support QUERY to reuse responses for identical request bodies.
- Signals safety and idempotence so clients and intermediaries may retry safely and cache more aggressively.
Deployment considerations and checklist
Before adopting QUERY in production, validate compatibility across your entire network path:- Confirm that load balancers, CDNs (e.g., CloudFront), reverse proxies, and WAFs recognize QUERY or at least forward it unchanged.
- Verify how your CDN or cache computes cache keys — can it include the request body for cache lookups?
- Ensure your application server/framework supports the QUERY method and correctly parses bodies for that method.
- Test retry behavior in failure scenarios to ensure safe idempotent semantics are preserved.
- Unit test server handling of QUERY requests and body parsing.
- Staging: run end-to-end tests across your full network path (load balancers, proxies, CDN, WAF).
- Production canary: route a small percentage of traffic to QUERY-enabled endpoints and monitor errors and cache hit rates.
- Only reads data (does not change server state — i.e., is safe), and
- Is idempotent — sending it multiple times has no additional side effects.
Test QUERY thoroughly with your entire network path (CDNs, load balancers, proxies, WAFs). Some providers may not recognize QUERY or might treat it like POST or reject it; verify caching behavior and safe retryability in your environment.
References
- AWS CloudFront limits: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/limits.html
- HTTP methods overview: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
- HTTP semantics (RFC 7231): https://tools.ietf.org/html/rfc7231