How to disable/enable cache between dev and production environment

R

RedHair

Development: Windows 2003
Production :Windows 2003
ASP.NET 2.0 + C#

I want to disable the cache feature of all pages in dev but enable it in
production environments.
What's the solution?
If uses cacheProfiles in web.config then I need to deploy different
web.config files from dev
to production sites.

Thanks
 
K

kferron

Well first let me say that in most cases, the web.config in a dev
environment and a production environment will need to be different.

Second.. what "cache feature" are you speaking of? Theres a number of
different contexts in which things are being cached, and you as the
developer have control of.

You may want to look into preprocessor directives if you're talking
about actually disabling calls to caching specific code that you've
implemented.

(You should also consider the fact that you would really need to be
able to build with caching in dev also, in cases where you are dealing
with and debugging logic related to caching.)
 
R

RedHair

Thanks.
(1) I keep one copy of web.config in VSS, and used it for dev/production and
each
developer's isolated dev environments. Instead, creating a external
reference config
file for each enviornment and doesn't add it to VSS, this will be easier to
manage
and configure all environments.
(2) The cache here means the Page and User Control caching
(3) I'd like have longer caching duration in production but shorter in dev
environment,
because the webform page will read xml file then render html content to
client, if we change
the webform file, there is no problem, but if the designer changes the xml
or xslt files, then
the output won't be changed until the caching is expired.
 
K

kferron

Your easiest solution is creating an xml file that acts as a dependency
to the cache. If you just touch the file it will invalidate the cache..
in development you can just make sure your pages are touching the
dependency where appropiate
 
R

RedHair

Thank you!.

You mean that put the xml and xslt as data cache besides the webform
page cache? This will also increase the performance?

I had a performance testing via WAST,if a webform page is already added
the outputCache detective, then no matter the included user control(ascx)
is added the outputCache detective or not. the result is almost same .
 

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,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top