Skip to main content
December 30, 2009
Question

Clearing the cache in production...

  • December 30, 2009
  • 1 reply
  • 627 views

What effect if any does clearing out the cache have on session variables?

Also, is anyone aware of any potential adverse side effects on user experience when clearing out the cache durring normal business hours?

Thank you,

Mike

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    January 3, 2010

    What cache are you talking about? There are quite a few, notably query and template.

    I would assume you mean template caching. Then that is a bit of a trick question.

    I cannot imagine circumstances where clearing the cache will affect session variables. For a start, you would have cached only pages that have static content. You wouldn't have cached pages containing session variables, as these are dynamic content.

    So, assuming you cached only pages containing static content, as you should have, clearing the cache wont affect session variables. However, request performance will decrease. It is therefore advisable to clear the cache when there is little activity at your site.

    Inspiring
    January 4, 2010

    I would assume you mean template caching. [...]

    [...]. For a start, you would have cached only pages that have static content. You wouldn't have cached pages containing session variables, as these are dynamic content.

    How do you mean?  The template cache caches compiled CFM (and CFC) templates in RAM.  What's that got to do with static / dynamic content?

    --

    Adam

    BKBK
    Community Expert
    Community Expert
    January 4, 2010
    The template cache caches compiled CFM (and CFC) templates in RAM.  What's that got to do with static / dynamic content?

    I have used the term the template cache as a synonym of page cache. Template cache doesn't do the caching, as you suggest; it is the cache.

    If a template's content changes constantly, that is, if it has dynamic content, that will defeat the purpose of Coldfusion caching it. It doesn't matter how or where Coldfusion caches CFM and CFC templates. Caching is for templates that change infrequently or, ideally, that are unchanging or static. The same goes for Coldfusion's caching of connections, queries, etc..