The CFCACHEtag can perform two possible actions: CACHE, which causes the page to be cached, or FLUSH,which forces a cached page to be refreshed. The default action is CACHE.
the HTTP or HTTPS protocol can be used to create cached pages.
This attribute indicates which protocol to use by taking either HTTP: // or HTTPS:// as its value. The default value for the attribute is HTTP://
This attribute specifies a DateTime object indicating the oldest acceptable cached page for the document being cached. If the cached page being requested is older than the date, then the page is refreshed in the cache. For insolence, to indicate that a cached page should be no older that 24 hours, you could use #DateAdd( “h” , “- 24” ,Now())# as the value of the TIMEOUT attribute. By default there is no timeout, which means that you will need to manually refresh pages by using the FLUSH action.
attribute is used with the FLUSH action to indicate the directory where the cfcache. mapfile to be used in the FLUSHaction is stored.
Expired This attribute is used with the FLUSH action to indicate filenames in the cf cache. mapfile that should be refreshed. These filenames can be specified with .A wildcards so that test. matches test. cfm as well as test.cfm?attribute=value. Because all the attributes of the CFCACHEtag are optional and have reasonable default values, to cache pages it is often enough to include a basic VCACHEtag at the top of all documents to be cached. The only attribute that you may want to set manually is the TIMEOU Tattribute-to give it a value that makes sense for the data sources being used by the pages being cached. Alternately, instead of specifying timeouts in all your CFCACHE tags, you can simply build a separate template that flushes the necessary cached files and then schedule that template to run as needed by using the scheduling feature of ColdFusion.
Load Balancing Using ClusterCATS
At some point, a popular or heavily used ColdFusion server is going to hit a ceiling where additional hardware becomes necessary to improve performance. When this happens, . several factors come into the decision, but ultimately the question at hand will be: Do you
increase the power of your existing server or move to multiple servers? The answer is never easy, but the experience of many Web administrators suggests the following:
• When originally purchasing your server, purchase server-class hardware that supports multiple processors (but initially you may want to installation)’ one processor).
• If you need to upgrade, consider adding a second processor to your system if it has only one. This generally provides a cost-effective but significant boost in server CPU performance of roughly 70 percent.
• If your current server already has two processors, consider adding a second two processor server rather than adding two more processors to your server.
Each additional processor in a multi-processor system offers less of a performance gain than the preceding processor. In fact, a four-processor system offers about 2.5 times the CPU performance of a single processor system whereas a two-processor system offers about 1.75 times the performance of the single-processor system. Two two process() r systems will offer about 3.5 times the performance of the single-processor system, a significant improvement over a single four-processor system. If you have reached the point where you are deciding to implement multiple Cold- Fusion and Web servers, you need to consider points in your deployment:
• Keeping your systems consistent
• Replicating data between your systems
• Balancing traffic between your systems
Keeping Your Systems Consistent
Generally, if you are installing multiple ColdFusion servers for your applications, you . will want to install and run the same set of applications on all your systems. This helps keep your systems consistent and easy to manage. If your systems have widely differing installed applications and configuration settings, managing the systems becomes extremely difficult. Instead, to ease your management task and ensure that the user experience is , try to keep system configurations as close as possible to one another across your multiple Web/ColdFusion servers.
Replicating Data between Your Systems
If you plan to run the same applications on multiple servers, you need a system for keeping the content of your applications synchronized across your servers. There are several approaches to doing this:
• Use a replication application such as Robocopy, which is part of the Windows NT Resource Kit.
• Maintain a separate development copy of your sites and then use an integrated development tool such as ColdFusion Studio or NetObjects Fusion to publish your content to multiple production servers Use the built-in replication service provided by ClusterCATS (assuming that you decide to use this component of ColdFusion server). ClusterCATS is discussed later in this chapter.