Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Invalidate cache policy clears all entries with PurgeChildEntries=true

I have a proxy that uses a populate cache policy to cache the response content.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="PC-PopulateCache">
<DisplayName>PC-PopulateCache</DisplayName>
<Properties/>
<CacheResource>users-cache</CacheResource>
<Source>response.content</Source>
<CacheKey>
<Prefix/>
<KeyFragment ref="request.uri"/>

<KeyFragment ref="userid"/>
</CacheKey>
<Scope>Global</Scope>
<ExpirySettings>
<TimeoutInSec>3600</TimeoutInSec>
</ExpirySettings>
</PopulateCache>

 

I call an endpoint of another proxy to invalidate the cache. This is my invalidate cache policy with PurgeChildEntries=true.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<InvalidateCache async="false" continueOnError="false" enabled="true" name="IC-InvalidateCache">
<DisplayName>IC-InvalidateCache</DisplayName>
<CacheKey>

<Prefix />
<KeyFragment ref="userid"/>
</CacheKey>
<CacheResource>users-cache</CacheResource>
<Scope>Global</Scope>
<PurgeChildEntries>true</PurgeChildEntries>
</InvalidateCache>

 

I am expecting all entries related to <KeyFragment ref="userid"/> to be removed. However, all entries in the cache are being removed. 

With <PurgeChildEntries>true</PurgeChildEntries>, shouldn't it remove only related entries from the cache instead of the entire cache?

0 6 635
6 REPLIES 6