Performance and caching of composite console

Topics: General
Mar 17, 2011 at 11:57 AM

ref: [discussion:232878] (http://compositec1.codeplex.com/discussions/232878)

Lots of the content we serve from our site usually requires that the user doesn't cache the output, so the default setting we use under IIS is to expire content immediately.

How does this affect caching and performance of the Composite C1 console, should we be adding sections to the web.config as per below to put caching back in for the Composite console, or will this cause problems? If not, could these settings be summarised with a 7-day cache on the entire Composite directory?

Andy

 
  <location path="Composite/content/misc/editors/visualeditor/tiny_mce">  
    <system.webServer>
        <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
        </staticContent>
    </system.webServer>
  </location>
  
  <location path="Composite/images">  
    <system.webServer>
        <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
        </staticContent>
    </system.webServer>
  </location>
  
  <location path="Composite/skins/system">  
    <system.webServer>
        <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
        </staticContent>
    </system.webServer>
  </location>
  
  <location path="Frontend/Config/VisualEditor/Images">  
    <system.webServer>
        <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
        </staticContent>
    </system.webServer>
  </location>
Coordinator
Mar 18, 2011 at 3:29 PM

I haven't played around with <clientCache /> and the C1 Console so I can't give you a straight answer, but if you can configure your global IIS rule to "do nothing" below "/Composite" I would suggest that approach. If you need I rule, then try the one below - the static files we serve from inside /Composite should not require any frequent refreshing.

  <location path="Composite">  
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
</staticContent>
</system.webServer>
</location>

In general the content served from the /Composite folder (the C1 Console) should not need any global rules on expiration. We have pretty much fine tuned the major downloads, using relevant techniques. Dynamic content is always expired immediately, while most icons are served via a handler have something like a lifespan of a week. .js and .css files are requested with the full Composite C1 version number in the URL and then allowed to permanently cache on the client. When Composite C1 is upgraded the URL for those resources are automatically updated.

In general our experience is that "it just works" with default setup. After doing a version upgrade users will be shown a 'version have updated, consider clearing your cache' message, so major upgrades are the only time where a cache flush can make sense.

Your rule about the Visual Editor images make sense - typically this is a very static set of images, but a weeks refresh time is probably not hurting anyone.

Not a real answer, but I hope it is helpful anyway :)

Mar 18, 2011 at 4:20 PM

>> Not a real answer, but ...

Works well for me. Should we remove cache control from the Front End folder as well?

The default cacheControlMode in IIS is NoControl, so setting this on the Composite location would turn off IIS cache control and leave it to the Composite code - would this be the best setting? If so it might be worth explicitly including this in your web.config so that settings on the root site don't affect it.

IIS reference is here: Client Cache

The only reason we looked at this was because our testing was showing really slow response times for commands, and we saw the images being requested a lot, probably due to our Expire Immediately setting.