2 newbie usercontrol ?s (cacheing and nesting)

D

darrel

I'm easing my way into .NET by building some new templates for our web site
using userControls. For now, they're mostly replacements for includes, but I
hope to move towards a template engine at some point.

Anyways, couple newbie questions:

1) Cacheing.

It appears that I can have .net cache a page by adding an OutputCache
declaration:

<%@ OutputCache Duration="600" VaryByParam="none" %>

This seems like a good thing to add to the more static parts of our
site...like the footer. How long should one cache something like that? Is
there a rule? I assume a day would be good, but maybe 10 minutes is just as
valid in terms of any real affect on the server. If you do cache it, will
that cause headaches when I need to update it? For instance, if I set the
cache to 1 day, would I need to wait an entire day to see any updates, or
does .NET monitor the files and reset the cache once it's been changed?

2) nesting.

Can a UserControl import an ascx file that contains another user control? If
not, can a UserControl import an ascx file that contains a plain-old
include?

Thanks!

-Darrel
 

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,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top