简体   繁体   English

C#-AWS API网关刷新缓存

[英]c# - aws api gateway flush cache

Is there any way to flush aws API gateway cache for the particular stage through c# code? 有什么方法可以通过C#代码刷新特定阶段的AWS API网关缓存? I have a requirement to synchronize my api with frequently changing data at the backend. 我需要将我的api与后端频繁更改的数据同步。 Once data updated in database my code should clear the api gateway cache so that user will see the updated result on the UI. 数据库中的数据更新后,我的代码应清除api网关缓存,以便用户可以在UI上看到更新的结果。

I found articles in aws which uses CLI commands to clear cache. 我在aws中找到了一些文章,这些文章使用CLI命令清除缓存。 Below is the link for reference Please help me to find the similar c# code for the same. 以下是参考链接,请帮助我找到相同的类似c#代码。

{

AmazonAPIGatewayClient amazonAPIGatewayClient = new 
AmazonAPIGatewayClient(Amazon.RegionEndpoint.EUWest1);
FlushStageCacheRequest req = new FlushStageCacheRequest
 {
            RestApiId = "APIID",
           StageName = "yourAPIstagename"
};
        FlushStageCacheResponse response = 
amazonAPIGatewayClient.FlushStageCacheAsync(req).Result;

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM