Original posted on www.experimentsincode.com

I need a quick way to disable HTML caching on a Sitecore server. I didn’t want to mess around with the sites setting because I wanted something a little more generic.

You might be tempted to set Caching Enabled to false.

    <!--  CACHING ENABLED
            Determines if caching should be enabled at all
            Specify 'true' to enable caching and 'false' to disable all caching
      -->
        <setting name="Caching.Enabled" value="true" />

However changing this to false will cause your site to never load! A better solution is to use the HTML Lifetime setting:

      <!--  HTML LIFETIME
            The lifetime of HTML fragments added to the cache.
            Default value: 00:00:00 (ie. eternal life)
      -->
    <setting name="Caching.HtmlLifetime" value="00:00:00" />

Change this from 00:00:00 to 00:00:01.

Glass needs your support!

Glass.Mappper.Sc is supported by the generous donations of the Glass.Mapper.Sc community! Their donations help fund the time, effort and hosting for the project.

These supporters are AMAZING and a huge thank you to all of you. You can find our list of supporters on the Rockstars page.

If you use Glass.Mapper.Sc and find it useful please consider supporting the project. Not only will you help the project but you could also get a discount on the Glass.Mapper.Sc training and join the Rockstars page.

Become a Rockstart