3

I heard on a recent podcast (Polymorphic) that it is possible to cache a user control as opposed to the entire page.

I think my header control which displays static content and my footer control could benefit from being cached.

How can I go about caching just those controls?

2 Answers 2

4

Take a look here
You can use VaryByParam and VaryByControl in the output cache.

Sign up to request clarification or add additional context in comments.

Comments

1

I think you can specify OutputCache in the control's markup file like you'd do on an ASPX page. And it'd get properly cached automatically.

Just read up on OutputCache page directive on MSDN and get the parameters right and it should do what you want it to.

It's been a long time since I write classic ASP.NET but I believe that's how it's done.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.