Version 6 is the first version of CFWebstore to drop support for ColdFusion 5 and exclusively support CFMX and up. This allowed for use of many of the new CFMX features, most notably ColdFusion Components (CFCs). Most of the core shopping and checkout functions are now run through CFCs. To improve site performance even more, these are loaded into application memory and cached so that they only have to be initialized once. For a typical busy store, this will be the case: they are loaded into application memory on the first hit and each subsequent hit will retrieve the saved components. Likewise with the template and query caching that ColdFusion does.
If you don't have a busy store though, and only a few visitors drop in per day, these stored components may actually expire from memory between visits. The result of this is an initial page load that is quite long. Wouldn't it be nice to avoid this long page load and make sure your site loads quickly for each and every visitor? Well, actually this is a very easy thing to do! It's accomplished by setting up a simple scheduled task in ColdFusion. We just need to call the homepage of the site once an hour to prevent it from expiring and to keep all the components initialized.
If you have access to the CF Admin or your host provides a control panel for creating schedules, this is a fairly easy thing to do. Even if you don't have access though, you can create the task using a bit of CF code. What we want to do is just make sure that the store frontpage gets hit at least once every hour. This will keep all our components in stored memory and ensure that they don't timeout. Here's an example of how to create a scheduled task that will hit the CFWebstore homepage once an hour:
operation = "HTTPRequest"
url = "http://www.cfwebstore.com/index.cfm"
startDate = "11/02/2007"
startTime = "12:00 AM"
interval = "3600"
resolveURL = "No">
So how do we run this code? Well, the current version 6 release of CFWebstore actually includes a page that can be used as a "scratchpad" for testing or running code one time. This page is 'test.cfm' in the top-level store directory. Just drop this code into that page, modify for your own site, and then run the page by calling 'index.cfm?fuseaction=home.test'. You won't see anything on the resulting page(unless you typed something incorrectly and got an error) but the scheduled task should have been created. Now your store should stay initialized and load quickly on every visit!