User control cache duration

T

Thomas

I posted this in the Caching group but it looks like there's not much
activity, and I wanted to add a bit to the question.

Is there a way to set the cache priority of a user control in the
OutputCache directive?

Second, are there any settings in the web.config that affect caching
(ie memory usage, etc.)?

Thank you,
Tom
 
L

Landi

YES, There are settings in the web.config file for caching.
It will depend on what you want to do though.
More information is needed.

--Landi
 
T

Thomas

Thanks very much for the replies, Alvin and Landi.

Well, let's see how brief I can make it :)

Originally, I fragment caching my user controls. This worked great.
But I was noticing in my production environment (which is just a
shared host on WebHost4Life) my caches were getting dumped quite
frequently. My site isn't getting a lot of activity, so I'm guessing
the server was just reclaiming RAM.

What I've done in the meantime is turn off outputcaching, and instead,
store the result of the database query (the methods return arrays)
into the cache. This way, I can set the priority: so on the home page
controls, for example, I just set the priority to NotRemovable. So
far, this seems to work better. I don't mind if it dumps some of the
controls, but without caching, some of the pages make about 5 database
calls and most of it is for small things, like a random quote, etc.

What I'm hoping to learn is: what settings in the Web.Config can I
make that, perhaps, give some of this functionality, such as priority
and/or dependancy? Thinking as I write, I suppose I could load the
control dynamically, then stuff it in the cache (hmm...good/bad idea?)

Thanks for the help!
Tom
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top