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:
1 <cfset sleep(9000)>
2 Done sleeping.
I can cache the result of this code (the output) by adding the custom tag:
2 Done sleeping.
1 <cf_scopecache scope="application" name="mycodeisntslow" timeout="3600">
2 <cfset sleep(9000)>
3 Done sleeping.
4 </cf_scopecache>
Pretty simple, right? There are more options of course. See the documentation in the tag itself.
2 <cfset sleep(9000)>
3 Done sleeping.
4 </cf_scopecache>
Comment 1 written by John C. Bland II on 28 February 2008, at 10:28 AM
ie - application.cache.mycodeisntslow vs application.mycodeisntslow
Thanks.
Comment 2 written by Raymond Camden on 28 February 2008, at 10:31 AM
Comment 3 written by Aaron Lynch on 28 February 2008, at 4:16 PM
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.
Comment 4 written by Raymond Camden on 28 February 2008, at 5:28 PM
Comment 5 written by Charlie Arehart on 1 March 2008, at 2:21 AM
http://www.carehart.org/resourcelists/tools_to_con...
Comment 6 written by Nate on 22 May 2008, at 5:56 PM
Comment 7 written by Raymond Camden on 22 May 2008, at 7:55 PM
Comment 8 written by Nate on 2 June 2008, at 11:42 AM
Comment 9 written by Raymond Camden on 2 June 2008, at 1:51 PM
I don't see this here, but if you can try to make a reproducible case, I'd definitely appreciate it.
Comment 10 written by Nate on 3 June 2008, at 4:49 PM
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?
Comment 11 written by Raymond Camden on 4 June 2008, at 8:39 AM
Comment 12 written by Nate on 8 August 2008, at 12:50 PM
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.
Comment 13 written by Raymond Camden on 8 August 2008, at 3:00 PM
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]