Skip to content

Commit

Permalink
doc fixes and max-age set to 60
Browse files Browse the repository at this point in the history
  • Loading branch information
makdharma committed Sep 28, 2016
1 parent a04c678 commit 012fc18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions doc/interop-test-descriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,17 @@ of POST, and that server sets appropriate cache control headers for the response
to be cached by a proxy. This interop test requires that the server is behind
a caching proxy. Use of current timestamp in the request prevents accidental
cache matches left over from previous tests.
Note that client adds a `x-user-ip` header with value `1.2.3.4` to the request.
This is done since some proxys such as GFE will not cache requests from
localhost.

Server features:
* [CacheableUnaryCall][]

Procedure:
1. Client calls CacheableUnaryCall with `SimpleRequest` request with payload
set to current timestamp.
set to current timestamp. Timestamp format is irrelevant, and resolution is
in nanoseconds.
2. Client calls CacheableUnaryCall with `SimpleRequest` request again
immediately with the same payload as the previous request.

Expand Down Expand Up @@ -965,13 +969,12 @@ for the `SimpleRequest.response_type`. If the server does not support the
### CacheableUnaryCall
Server gets the default SimpleRequest proto as the request. The content of the
request are ignored. It returns the SimpleResponse proto with the payload set
to current timestamp string. In addition it adds
request is ignored. It returns the SimpleResponse proto with the payload set
to current timestamp. The timestamp is an integer representing current time
with nanosecond resolution. In addition it adds
1. cache control headers such that the response can be cached by proxies in
the response path. Server should be behind a caching proxy for this test
to pass.
2. adds a `x-user-ip` header with `1.2.3.4` to the response. This is done
since some proxys such as GFE will not cache requests from localhost.
to pass. Currently we set the max-age to 60 seconds.
### CompressedResponse
[CompressedResponse]: #compressedresponse
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/interop/interop_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class TestServiceImpl : public TestService::Service {
gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME);
std::string timestamp = std::to_string(ts.tv_nsec);
response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size());
context->AddInitialMetadata("cache-control", "max-age=100000, public");
context->AddInitialMetadata("cache-control", "max-age=60, public");
return Status::OK;
}

Expand Down

0 comments on commit 012fc18

Please sign in to comment.