469,329 Members | 1,438 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,329 developers. It's quick & easy.

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

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...
Nov 17 '05 #1
0 932

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Sarir Khamsi | last post: by
6 posts views Thread by wukexin | last post: by
6 posts views Thread by d.warnermurray | last post: by
3 posts views Thread by Colin J. Williams | last post: by
7 posts views Thread by Corepaul | last post: by
4 posts views Thread by dixie | last post: by
9 posts views Thread by JJ | last post: by
8 posts views Thread by Mark | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.