In a previous blog entry titled IsDefined() Vs. StructKeyExists() - The Nuances of CFMX Structures, I illustrated the point that non-standard variable names like "33foo" can be used as keys to a structure, even though setting them directly causes the dreaded "invalid variable name" error. You may not know it, but Ray Camden's popular cfc blog software exploits this feature using his "scope cache" tag to ensure unique structure keys in the cache.
When Ray initializes the cache for blog CFC he does it in the application scope using the CGI.Query_string as the key name for the application scope. Here's the snippet from the index page.
Incidentally, scopecache is an outstanding tag - simple and elegant. It's the grease that makes blog cfc so fast, and hence so ubiquitous among us Coldfusion types. Ray uses scope cache to build a self-tuning site that remains in memory and serves up lickety split. Good stuff!
There are no comments for this entry.Add Comment Subscribe to Comments