Expected Behavior or Use Case
We should add the Cache-Control with max-age property to indicate when the query will expire.
Presto Component, Service, or Connector
Presto client protocol
Possible Implementation
- In both
ExecutingStatementResource and QueuedStatementResource, modify the response builders to include the Cache-Control header
- Use the
getLastHeartbeatInMillis field from TrackedQuery to calculate the appropriate max-age value. For /v1/statement, a simple addition of an expiration time should be added in QueuedStatementResource#Query and piped into the max-age value, since right now these technically never expire at the moment.
- The header should be formatted as:
Cache-Control: max-age=<seconds>
Example Screenshots (if appropriate):
Context
The query expiration can be used by an intelligent router to retry queries. For context, see #25396 and #25397