Posted in ColdFusion | Posted on 02-28-2008 | 2,362 views
Last night I released ScopeCache on RIAForge. This isn't new code. It's the caching custom tag I've had for a few years now. Charlie Arehart mentioned to me that it wasn't possible to find the code anymore (outside of BlogCFC), so now I have a place for folks to find it.
I also did some small updates to it, including giving it the ability to cache in the request scope.
For folks who don't know what this tag is, it's a basic way to quickly add caching to a page. So imagine the following slow code:
2Done sleeping.
I can cache the result of this code (the output) by adding the custom tag:
2<cfset sleep(9000)>
3Done sleeping.
4</cf_scopecache>
Pretty simple, right? There are more options of course. See the documentation in the tag itself.


ie - application.cache.mycodeisntslow vs application.mycodeisntslow
Thanks.
In other words, instead of just scope="Application", there could be an optional attribute of structName...
scope="Application" structName="cache"
That is my take on it at least.
http://www.carehart.org/resourcelists/tools_to_con...
I don't see this here, but if you can try to make a reproducible case, I'd definitely appreciate it.
I have a new question for you / feature request.
Let's say Scopecache caches 10000 code fragments and the memory/size of those variables starts taking up too much RAM. Might it be a nice feature to automically clear 2000 or so variables(those variables with the smallest hit count) when that happens?
How about a way to save the cache and restore it at a later time after a server is shutdown and restarted? Keeping a history of the cache on a daily or weekly basis would be a very nice feature.
Log a bug request for this at RIAForge. (If I didn't turn it on, bribe me with a beer and I'll do so.)
[Add Comment] [Subscribe to Comments]