I'm a little confused about the granularity offered by the HttpResponse.RemoveOutputCacheItem()
call. I'm interested in performing some output caching on dynamically-generated images, and would like to vary the output cache using at least to paramaters (let's call them 'id' and 'size' for argument's sake).
So, for example:
/Image/User?id=1 /Image/User?id=1&size=1 /Image/User?id=1&size=2
Would be cached seperately.
When a given user changes their picture; I would want to invalidate all output cache items for that user id (regardless of size). This question answers my question about a single particular parameter. But..how would I go about flushing all cached responses for a user without regards to the size param? (Let's assume I wouldn't know all of the possible values of 'size' ahead of time).
I'd ideally like to do something like:
HttpResponse.RemoveOutputCacheItem("/Image/User?id=1&size=*"); //wishful thinking
Can anyone point me in the right direction?
Edit
@JcMalta proposed a promising solution, however I can't find an appropriate collection that is exposed for items in the output cache. A viable solution might include an operation similar to what he proposed if this exists somewhere.