Help! User control caching not working in Mozilla, works in IE

M

Mike Kingscott

Meant to post in here as well...

Hi there,

I have a user control that brings back some links from a database
based on a combination of querystring parms, so I'm using VaryByParm
to differentiate between the pages. The code is like so:

<%@ OutputCache Duration="3600" VaryByParm="scid;cid" %>

(you get the idea)

The control itself examines the querystring for the presence of these
parms, and calls a stored proc with varying parms based on what is
found, i.e. passes in different parms based on whether scid, cid, or
nothing is present. The resulting SqlDataReader then returns targeted
links back to the browser.

Clearly, I don't want a database lookup on every single page, so
caching is a shoe-in here. So, I put the cache instruction in the page
as above, and then had SQL Profiler working against the db. As I
loaded default.aspx (which doesn't have the cid or scid parms), I saw
a call to my stored proc. As I loaded the rest of the pages that
didn't have the cid or scid parms on the querystring, I didn't see the
stored proc called again, which is what I was expecting. So far, so
good.

Next, the pages with the cid and scid parms - again, no problems :) I
saw the stored proc called for each page I clicked with varying parms,
and when I revisited the page, the stored proc was not called, also
what I was expecting.

As an aside, one thing that I wasn't expecting happened - the db call
gets executed again when the page performs a postback - why?

Anyway, back to the real problem: I then fired up Mozilla and tested
the site. ***SQL PROFILER SHOWED A CALL TO THE STORED PROC EVERY
PAGE***, in other words, no caching...

Can anyone assist?

Kind regards,

Mike Kingscott

PS - If i use VaryByParm="None" on a user control, am I right that it
creates a cached version for every *page* it is used on? I have an
ad-rotator that should at least display a different ad each page... I
would only cache this for about 10 minutes though...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top