Skip navigation
MikeG518
Currently Being Moderated

Clearing the cache in production...

Dec 30, 2009 8:25 AM

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

 
Replies
  • Currently Being Moderated
    Jan 3, 2010 2:20 AM   in reply to MikeG518

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 4, 2010 3:25 AM   in reply to BKBK

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 4, 2010 10:41 AM   in reply to Adam Cameron.
    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..

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 5, 2010 2:15 AM   in reply to BKBK
    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.

     

    Right.  So differently from how CF uses the term.  That's a bit confusing isn't it?

     

    Template cache doesn't do the caching, as you suggest; it is the cache.

    I think you're splitting hairs "a bit" there.  What would you call the mechanism that puts the cached CF templates into the template cache then?

     

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

    Well yes, I suppose if one is continually writing CFML to templates dynamically before calling them with <cfinclude> or something, it does defeat the purpose of the template cache slightly.  This describes a shrinkingly insignificant proportion of template requests though, in any sanely-built system.  However the template cache caters for that eventuality as much as it can by weighting the usage of the templates in the cache.  If it runs out of space in the cache, it cycles out the least-used templates first.

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 5, 2010 10:35 AM   in reply to Adam Cameron.

    @Adam Cameron

    You asked me this question:

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

    The keywords in your question are static and dynamic. I have answered the question in full. You swim along with the answer, but you don't acknowledge it.

    I think you're splitting hairs "a bit" there. 

    No, I'm not. Words can affect how we think.

     

    I would stay with "the template cache is a cache of templates", rather than "the template cache caches templates". I would also think of compiled CFM and CFC templates as being cached in a physical location like a directory on the browser or server, rather than in RAM.

     

    What would you call the mechanism that puts the cached CF templates into the template cache then?

    Coldfusion.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points