Caching with ASP.NET, can I use page directive programmatically

L

Leo Muller

I am impressed by the caching performance of .NET. However, there is one
major obstacle that I haven't managed to solve yet.

What I want to do is the following: I have a normal site, and a preview
site. The normal site should have maximum performance, thus uses caching.
The preview site is for internal use only, and should not use caching, since
our content managers will want to see the updates directly. The only
difference between the two sites is the web.config file.

If I use caching programmatically, then everything works out great, I add a
key in the webconfig, and only if this is the normal site then it will do
caching, otherwise it won't.
But if I use the caching through the page directives, <@OutputCache
Duration="300" VaryByParam="none"%>, then I can't vary this anymore between
my preview site and my normal site.

How can I overcome this problem?

Leo Muller
 

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,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top