Provide cache control on Google Cloud Endpoints

My final method generates a different response for each call, regardless of the parameter list. I often see my client invoke the endpoint with the same list of parameters, and the front end instance returns a cached response.

In the official documentation, I read that ApiMethod # cacheControl is deprecated. On the other hand, the documentation says that the @ Api-scopped @ApiCacheControl annotation is not yet implemented, so adding the following doesn't make any difference.

cacheControl = @ApiCacheControl( type = ApiCacheControl.Type.NO_CACHE ) 

To simplify the task, the documentation also says that

public @interface ApiCacheControl

Annotation for API cache management configuration. Please note that the API itself can act as a caching proxy.

Given the current state of the API, what is considered best practice for providing cache control?

+6
source share

Source: https://habr.com/ru/post/980495/


All Articles