我正在使用以下唯一键缓存几个请求...我正在使用内存中缓存。
urn:Product:/site.api.rest/product?pagenumber=0&pagesize=0¶ms=<Product><ProductID>3</ProductID></Product>
urn:Product:/site.api.rest/product?pagenumber=0&pagesize=0¶ms=<Product><ProductID>1</ProductID></Product>
urn:Product:/site.api.rest/product?pagenumber=0&pagesize=0¶ms=<Product><ProductID>5</ProductID></Product>
urn:Product:/site.api.rest/product?pagenumber=0&pagesize=0¶ms=<Product><ProductID>3</ProductID><Description>test</Description></Product>
...
...
现在,在创建/更新/删除中,我想删除特定的缓存(基于请求正文中传递的参数,例如所有 3.
为了做到这一点,我将从请求参数中获取 singleNode(例如:3)。
我怎样才能?
Get all cache objects which matches <ProductID>3</ProductID> and remove it?
Also, what is the right approach to remove cache?
base.RequestContext.RemoveFromCache(base.Cache, cachekey);
or
CacheClient.Remove(keyname)?