Skip to main content
Participant
April 8, 2008
Question

Clear template cache on multiple CF instances in a single action

  • April 8, 2008
  • 3 replies
  • 720 views
Does anyone have or know of a way to clear template cache across multiple CF instances in a single action?

I'm running several instances of Coldfusion on the same box with template caching turned 'on' for each instance. I have it set up where one instance will replicate file changes to the other instances, but with caching turned on, I currently have to log in to each CF Admin instance and click the "Clear Template Cache Now" button for the file changes to appear. As I add more instances, this will become an increasingly tedious process.
    This topic has been closed for replies.

    3 replies

    cfJarrodAuthor
    Participant
    April 10, 2008
    So how do I call each server instance? My domain, www.pongoresume.com, is part of one cluster that points to 4 instances and the CFIDE directory is secure and out side of webroot.
    April 9, 2008
    Correct. So you would need to code things so calls went out to each of your server instances. You could do this with cfhttp calls or a webservice. The idea of server instances is to isolate each instance from the others. You will need to architect your method to workaround that.
    Inspiring
    April 9, 2008
    cfJarrod wrote:
    > Does anyone have or know of a way to clear template cache across multiple CF
    > instances in a single action?

    use the admin API, runtime.cfc i think, it should have a method
    clearTrustedCache() to handle this.
    cfJarrodAuthor
    Participant
    April 9, 2008
    Thanks for the reply Paul...

    I'm assuming that using clearTrustedCache() will only clear the cache for a single CF instance and not all instances on the server. Is that in fact true? Ideally I'd like to run a single script that will clear the cache for all instances.