J
João Maia
Hello there,
I'm using Cache VaryByParam on a page and I'm not getting the
behaviour I expected. Here's what happens:
- I have page a.aspx declared with Cache VaryByParam="name"
- Page a.aspx has a label in which I set the time the page was
retireved by using DateTime.Now() on the server side (just to what
version of the page I'm getting, and if the cache is working)
- My requests to page a.aspx are generated in other pages, and usually
have more than one query string parameter, but the parameter "name" is
always there. For example,
"http://someserver.com/a.aspx?name=john&age=30", or
"http://someserver.com/a.aspx?name=john&age=30&city=lisbon" or
"http://someserver.com/a.aspx?city=30&name=john"
What I was expecting is that, when parameter "name" is "john", a.aspx
would be retrieved from the cache regardless of the values of the
other parameters. When the parameter "name" would change to "mary"
then a new version of a.aspx should be retrieved from the server
instead of from cache.
What's happening instead is that the page is ALWAYS retrieved from
cache (I can say that because of the datetime label I have on the
page), regardless of the value of query string parameter "name".
Can anyone tell me what's happening here, please ? Is this a weird
behaviour or am I doing something wrong ? BTW, this is ASP.NET 2.0.
Any help would be greatly appreciated.
Thanks in advance,
Joao Maia
I'm using Cache VaryByParam on a page and I'm not getting the
behaviour I expected. Here's what happens:
- I have page a.aspx declared with Cache VaryByParam="name"
- Page a.aspx has a label in which I set the time the page was
retireved by using DateTime.Now() on the server side (just to what
version of the page I'm getting, and if the cache is working)
- My requests to page a.aspx are generated in other pages, and usually
have more than one query string parameter, but the parameter "name" is
always there. For example,
"http://someserver.com/a.aspx?name=john&age=30", or
"http://someserver.com/a.aspx?name=john&age=30&city=lisbon" or
"http://someserver.com/a.aspx?city=30&name=john"
What I was expecting is that, when parameter "name" is "john", a.aspx
would be retrieved from the cache regardless of the values of the
other parameters. When the parameter "name" would change to "mary"
then a new version of a.aspx should be retrieved from the server
instead of from cache.
What's happening instead is that the page is ALWAYS retrieved from
cache (I can say that because of the datetime label I have on the
page), regardless of the value of query string parameter "name".
Can anyone tell me what's happening here, please ? Is this a weird
behaviour or am I doing something wrong ? BTW, this is ASP.NET 2.0.
Any help would be greatly appreciated.
Thanks in advance,
Joao Maia