问题
My endpoint method generates a different response for each invocation regardless of the parameter list. I often see my client call the endpoint with the same parameter list, and the front end instance returns a cached response.
In the official documentation I read that ApiMethod#cacheControl has been deprecated. On the other hand, the documentation says that the @Api-scopped annotation @ApiCacheControl has not been implemented yet so adding the following makes no difference.
cacheControl = @ApiCacheControl(
type = ApiCacheControl.Type.NO_CACHE
)
To make things easier, the documentation also says that
public @interface ApiCacheControl
Annotation for API cache control configuration. Note that the API frontend itself may act as a caching proxy.
Given the current state of the API what's considered best practice for enforcing cache control?
来源:https://stackoverflow.com/questions/27767263/enforce-cache-control-in-google-cloud-endpoints