How to disable/enable cache between dev and production environment

Discussion in 'ASP .Net' started by RedHair, Nov 15, 2006.

  1. RedHair

    RedHair Guest

    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
     
    RedHair, Nov 15, 2006
    #1
    1. Advertising

  2. RedHair

    kferron Guest

    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.)



    RedHair wrote:
    > 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
     
    kferron, Nov 15, 2006
    #2
    1. Advertising

  3. RedHair

    RedHair Guest

    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.


    "kferron" <> wrote in message
    news:...
    > 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.)
    >
    >
    >
    > RedHair wrote:
    >> 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

    >
     
    RedHair, Nov 15, 2006
    #3
  4. RedHair

    kferron Guest

    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


    RedHair wrote:
    > 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.
    >
    >
    > "kferron" <> wrote in message
    > news:...
    > > 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.)
    > >
    > >
    > >
    > > RedHair wrote:
    > >> 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

    > >
     
    kferron, Nov 15, 2006
    #4
  5. RedHair

    RedHair Guest

    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 .


    "kferron" <> wrote in message
    news:...
    > 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
    >
    >
    > RedHair wrote:
    >> 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.
    >>
    >>
    >> "kferron" <> wrote in message
    >> news:...
    >> > 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.)
    >> >
    >> >
    >> >
    >> > RedHair wrote:
    >> >> 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
    >> >

    >
     
    RedHair, Nov 15, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick
    Replies:
    1
    Views:
    671
  2. Mark Abbott
    Replies:
    2
    Views:
    344
    =?Utf-8?B?V296emE=?=
    Apr 19, 2006
  3. dgk
    Replies:
    5
    Views:
    338
    sloan
    Mar 20, 2007
  4. Shelves

    Deploy To Dev and Production

    Shelves, Jul 17, 2007, in forum: Java
    Replies:
    4
    Views:
    342
  5. Andrew Morton

    Dev and production web.configs

    Andrew Morton, Jun 26, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    322
    Andrew Morton
    Jun 30, 2009
Loading...

Share This Page