@gradientedge/cdk-utils 9.82.0 → 9.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -215,7 +215,7 @@ class AzureApiManagementManager {
|
|
|
215
215
|
cacheSetInboundPolicy = `<choose>
|
|
216
216
|
<when condition="@((string)context.Variables["bypassCache"] != "true")">
|
|
217
217
|
<!-- Attempt to retrieve cached response -->
|
|
218
|
-
<cache-lookup-value key="@((string)context.Variables["customCacheKey"])" variable-name="cachedResponse" />
|
|
218
|
+
<cache-lookup-value key="@((string)context.Variables["customCacheKey"])" variable-name="cachedResponse" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
219
219
|
|
|
220
220
|
<!-- If cache hit, return cached response -->
|
|
221
221
|
<choose>
|
|
@@ -237,13 +237,13 @@ class AzureApiManagementManager {
|
|
|
237
237
|
</choose>
|
|
238
238
|
</when>
|
|
239
239
|
<when condition="@((string)context.Variables["bypassCache"] == "true")">
|
|
240
|
-
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" />
|
|
240
|
+
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
241
241
|
</when>
|
|
242
242
|
</choose>`;
|
|
243
243
|
cacheSetOutboundPolicy = `<!-- Store the response body in cache -->
|
|
244
244
|
<choose>
|
|
245
245
|
<when condition="@(context.Response.StatusCode == 200)">
|
|
246
|
-
<cache-store-value key="@((string)context.Variables["customCacheKey"])" value="@(context.Response.Body.As<string>(preserveContent: true))" duration="${operation.caching.ttlInSecs ?? 900}" />
|
|
246
|
+
<cache-store-value key="@((string)context.Variables["customCacheKey"])" value="@(context.Response.Body.As<string>(preserveContent: true))" duration="${operation.caching.ttlInSecs ?? 900}" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
247
247
|
<!-- Add cache status header -->
|
|
248
248
|
<set-header name="X-Apim-Cache-Status" exists-action="override">
|
|
249
249
|
<value>MISS</value>
|
|
@@ -263,7 +263,7 @@ class AzureApiManagementManager {
|
|
|
263
263
|
<!-- Allow admin to clear specific cache entries -->
|
|
264
264
|
<choose>
|
|
265
265
|
<when condition="@((string)context.Variables["clearCache"] == "true")">
|
|
266
|
-
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" />
|
|
266
|
+
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
267
267
|
<return-response>
|
|
268
268
|
<set-status code="200" reason="OK" />
|
|
269
269
|
<set-body>Cache entry removed successfully</set-body>
|
package/package.json
CHANGED
|
@@ -266,7 +266,7 @@ export class AzureApiManagementManager {
|
|
|
266
266
|
cacheSetInboundPolicy = `<choose>
|
|
267
267
|
<when condition="@((string)context.Variables["bypassCache"] != "true")">
|
|
268
268
|
<!-- Attempt to retrieve cached response -->
|
|
269
|
-
<cache-lookup-value key="@((string)context.Variables["customCacheKey"])" variable-name="cachedResponse" />
|
|
269
|
+
<cache-lookup-value key="@((string)context.Variables["customCacheKey"])" variable-name="cachedResponse" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
270
270
|
|
|
271
271
|
<!-- If cache hit, return cached response -->
|
|
272
272
|
<choose>
|
|
@@ -288,13 +288,13 @@ export class AzureApiManagementManager {
|
|
|
288
288
|
</choose>
|
|
289
289
|
</when>
|
|
290
290
|
<when condition="@((string)context.Variables["bypassCache"] == "true")">
|
|
291
|
-
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" />
|
|
291
|
+
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
292
292
|
</when>
|
|
293
293
|
</choose>`
|
|
294
294
|
cacheSetOutboundPolicy = `<!-- Store the response body in cache -->
|
|
295
295
|
<choose>
|
|
296
296
|
<when condition="@(context.Response.StatusCode == 200)">
|
|
297
|
-
<cache-store-value key="@((string)context.Variables["customCacheKey"])" value="@(context.Response.Body.As<string>(preserveContent: true))" duration="${operation.caching.ttlInSecs ?? 900}" />
|
|
297
|
+
<cache-store-value key="@((string)context.Variables["customCacheKey"])" value="@(context.Response.Body.As<string>(preserveContent: true))" duration="${operation.caching.ttlInSecs ?? 900}" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
298
298
|
<!-- Add cache status header -->
|
|
299
299
|
<set-header name="X-Apim-Cache-Status" exists-action="override">
|
|
300
300
|
<value>MISS</value>
|
|
@@ -315,7 +315,7 @@ export class AzureApiManagementManager {
|
|
|
315
315
|
<!-- Allow admin to clear specific cache entries -->
|
|
316
316
|
<choose>
|
|
317
317
|
<when condition="@((string)context.Variables["clearCache"] == "true")">
|
|
318
|
-
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" />
|
|
318
|
+
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
319
319
|
<return-response>
|
|
320
320
|
<set-status code="200" reason="OK" />
|
|
321
321
|
<set-body>Cache entry removed successfully</set-body>
|