Reputation: 141
I try to control the cache headers of the response of my endpoint method (built on Google Standard AppEngine).
I found this two annotation ApiCacheControl and ApiMethodCacheControl in the framework, but they seem not working; my method response always come back with "Cache-Control=no-cache" header no matter how I configure those annotations.
Do you have an example how to use those?
If those are truly not working/supported, is there any other way that I can do to control my method response's cache header?
Reference to the above annotation can be found here: https://cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/ApiCacheControl
Upvotes: 0
Views: 173
Reputation: 1524
About 'ApiMethodCacheControl', as mentioned in the docs, is deprecated and you should not use it anymore.
Deprecated. ApiMethodCacheControl is deprecated and will be removed in a future version of Cloud Endpoints.
On the other hand, for ApiCacheControl
, as mentioned in Cloud Endpoints Frameworks annotations and syntax:
Note: The Javadoc lists some annotations that are currently not implemented. These annotations are: ApiCacheControl, and ApiFrontendLimits.
I found this Feature Request in the Public Issue Tracker.I would recommend you to "star" it to ensure that you receive updates about it. You can also adjust notification settings by clicking the gear icon in the top right corner and selecting settings.
I also found this other similar question without answer.
Finally in this question I did find an answer:
The Extensible Service Proxy (ESP) does not perform request caching. Its function is to intercept incoming requests, validate auth tokens, and then forward the request to Google Service Control where additional API Management rules are applied as defined in your Open API spec. Endpoints uses a distributed proxy model for better performance, to avoid the extra network hop that's typically incurred with a traditional multi-tenant API proxy. This is in fact the same model used internally within Google to power our own APIs.
Upvotes: 1