Just a small warning to folks using trusted cache on their production ColdFusion sites. If you have it enabled, hit a particular file, and then delete it, ColdFusion will still serve the file up. That isn't too surprising I suppose, but you may not be aware of it. While I bet most of you know that, I bet a lot of you may make the mistake I made.
Instead of clearing the entire Trusted Cache, I always use the newer folder option, see here:
This feature (which you can get via a ColdFusion Admin extension for older servers) lets you clear just one folder from the trusted cache. It is a kinder, gentler version of the "Nuke Everything From Orbit" button that clears the entire cache.
Except when I used this - it didn't work. It took me a few seconds (ok, minutes) to figure out why. The code behind this button gets all the files from the folder and clears them from trusted cache. Since the file I wanted to clear was deleted, it didn't work. The API for clearing the cache only supports files, not folders. (It should support both I'd say.) Obvious, right?
Archived Comments
Is there a difference between "template cache" and "trusted cache"?
I assume you mean, "Cache template in request" ? If so, that refers to how often CF will check a template during one request. Imagine a CFM does a cfinclude of foo.cfm a few times in one file. (Seems silly, but there are reasons why you may do that.) If this setting is on, CF will only load/parse the file once during the request. To be clear, it still executes the code right, but it doesn't re-check/parse the CFM after the first time.