APIM缓存不使用相同的不同参数

发布于 2025-02-13 20:56:02 字数 1128 浏览 0 评论 0原文

我正在研究APIM缓存和测试时。我发现缓存不起作用。如果下面的标题或查询参数(UserauthorizationToken,ProductCode,Pageno,limit)保持不变,则应返回缓存响应。

我正在使用Postman来调用“ GetProduct”传递参数来测试端点。然后,我在数据库中输入更多记录,然后再次致电GetProduct,它返回更多记录。但是,缓存持续时间未达到。

任何建议。

<policies>
    <inbound>
        <base />
    <cache-lookup vary-by-developer="false" vary-by-developer-groups="false" downstream-caching-type="none" must-revalidate="true" allow-private-response-caching="true" caching-type="internal" >
            <vary-by-header>userAuthorizationToken</vary-by-header>
            <vary-by-query-parameter>productCode</vary-by-query-parameter>
            <vary-by-query-parameter>pageNo</vary-by-query-parameter>
            <vary-by-query-parameter>limit</vary-by-query-parameter>
        </cache-lookup>
    </inbound>
    <backend>
        <base/>
    </backend>
    <outbound>
        <cache-store duration="2400" />
        <base/>
    </outbound>
    <on-error> ....etc

不幸的是,我无法在Azure Portal中访问APIM。

I am working on APIM caching and while testing. I found caching not working. If below header or query parameters (userAuthorizationToken,ProductCode, PageNo, Limit) remain same it should return cache response.

I am using postman to test the endpoint by calling "GetProduct" passing parameters. then I enter more records in database and call the Getproduct again it return more records. However, caching duration not met.

Any advice.

<policies>
    <inbound>
        <base />
    <cache-lookup vary-by-developer="false" vary-by-developer-groups="false" downstream-caching-type="none" must-revalidate="true" allow-private-response-caching="true" caching-type="internal" >
            <vary-by-header>userAuthorizationToken</vary-by-header>
            <vary-by-query-parameter>productCode</vary-by-query-parameter>
            <vary-by-query-parameter>pageNo</vary-by-query-parameter>
            <vary-by-query-parameter>limit</vary-by-query-parameter>
        </cache-lookup>
    </inbound>
    <backend>
        <base/>
    </backend>
    <outbound>
        <cache-store duration="2400" />
        <base/>
    </outbound>
    <on-error> ....etc

Unfortunately, I can't access APIM in azure portal.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文