
Signature
venlig hilsen / with regards
anders borum
--
Hi Anders,
Thank you for your prompt response. Allow me to try and explain
further my configuration/design and the problem at hand:
What I would like to do, is use output caching to save only this one
user control in the server's memory, and I want to vary by a list of
parameters (flight number, airline name, arrivals/departures,
scheduled arrival time, etc.).
The 'problem' is that all of these parameters are obtained from a form
that submits to "Index.aspx" (the form is a separate user control).
The "Index.aspx" page processes these variables and uses them to build
a SQL statement. This SQL statement is run in the database, and the
results are appended to an XML document (in memory). My
"SearchResults.ascx" user control is then responsible for loading all
the flight-related data from the XML and binding it to the two
different asp:Repeater controls.
Given the above structure, I'm not sure if it will be possible to
cache only this user control, since it grabs all of its data from an
XML document... it has no direct relationship to the querystring.
If it is not possible to achieve partial caching given the
above-mentioned design, then a second option would be for me to cache
my Index.aspx page only for certain parameters. For example, I would
like to set it up so that only the page
"http://<servername>/Index.aspx?AIRLINE=AirCanada&FLIGHTNUM=123&TERMINAL=1"
is cached. My whole website is controlled using query string
parameters, so it isn't really feasible for me to use
"VaryByParam='*'". Is there any way to enable caching on only one
specific querystring??
Thanks again for the help.
-Dan Bishop
> Hello!
>
[quoted text clipped - 5 lines]
>
> Let's see some code, unless the above suggestion helps!
Anders Borum - 04 Dec 2003 21:45 GMT
Hello!
> Is there any way to enable caching on only one specific querystring??
Good reply. I'll try another suggestion if this one doesn't work. Yes, you
can cache based on a list of parameters for a specific UserControl.
Not sure if you've been there before, but what you need to do is write a
list of parameters in the VaryByParam directive.
VaryByParam="AIRLINE;FLIGHTNUM;TERMINAL"
This should basically enable the UserControl to cache all combinations of
the above three parameters (regardless of them being QueryString or Form
posts).
And thus the partial caching kicks in - high performance. How about that?

Signature
venlig hilsen / with regards
anders borum
--