Caching Design Issue

  • Thread starter Thread starter RMD
  • Start date Start date
R

RMD

I am creating a portal that uses UserControls as each "portlet". Each of
these UserControls is autonomous in the sense that whether or not they are
loaded is determined completely at runtime, and they are independent
mini-applications. So far, so good.

Each of these UserControls has a title bar (just like in windows) that has a
nifty little menu. What I would like to do is have an item on this menu
called "Refresh" which forcefully clears the output cache for a particular
portlet.

I'm hoping that I can do something like capture the "Refresh" menu item
event and pass that information to the containing page, which then does
something like "somePortlet.Cache.Clear()".

I've investigated the various "VaryBy" mechanisms, and I'm not sure how I
can use these to accomplish what I want.

Thanks,
RMD
 
What about a parameter called Clear? Set it to 1, then you can varybyparam
....

Justin Dutoit
 
Well that's the problem. First, I don't want to use query string variables
if I can avoid it. (I currently have a very pretty and bookmarkable URL
that's parsed by an HTTP Module.)

Second, querystring variables, as you know, are page-wide... but this is a
per-usercontrol cache. I don't want to clear the cache of all usercontrols,
just specific ones.

I guess I'm confused as to how varybyparam works with usercontrols versus
pages. Wouldn't I have to have a unique querystring variable for each
usercontrol to look at? How would I do this if I can't necessarily know what
controls I going to be on the page until runtime. I suppose I could mandate
GUIDs for VaryByParam, but that seems kinda hacky.

RMD
 
Maybe you could make a token change to some data the user control depends
on.

hth
Justin
 
Back
Top