How to enforce http header no-cache when generating following protobuf?
Suppose we have the following rpc method defined within a proto file, including the http option. the http get option enables us to also generated a http gateway API endpoint
// AssignTask gets a specific task type and id for the current logged in user
rpc AssignTask (google.protobuf.Empty) returns (AssignTaskResponse) {
option (google.api.http) = {
get: "/v1/task/assign"
};
}
When generating the api with ProtoC
The problem we faced is that some browsers might cache this particular api call because caching enabled in the browser. Even if the payload of the request would contain the user the GET call could be cached by the browser if the response does not have the http no-cache header.
The question is how can we enforce the http no-cache in the response of the generated api via a definition in the proto file?