Enforce Cache-Control in Google Cloud Endpoints

混江龙づ霸主 提交于 2021-02-07 01:57:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!