I Want Your BrAAiIINS!!!

Because I couldn't decide if this blog entry should parody Uncle Sam or Night of the Living Dead. ;)

Yesterday I published Release Candidate 2 and rolled the version forward to 1.1 instead of 1.0 because there's actually been a significant amount of change to the system in the last 2 weeks, so I felt like RC2 should have a new minor version number as well.

The latest zip is available on the official site.

There are three major changes from RC1.


Recommendations for eviction policies are now handled by a separate intelligence.cfc which you can customize by copying to the /settings directory. This component ultimately doesn't make the recommendations itself, instead deferring to a collection of smaller components that I'm calling "brains". Each brain has one function to accept statistics for a caching agent and optionally return a single recommendation about how to configure the eviction policy for the agent.

In the Management Application there's now a link in the Options page to Optimize that displays a list of your agents with all the suggestions made by these brains for you to select the ones you want to apply (instead of simply applying them all as the RC1 release did). The auto-configuration routine is the same except that it stops at the first recommendation made for each agent, because it can only apply one.

I want your brains! This is an open challenge to all ColdFusion developers. There's some information in the documentation PDF about how to write a new brain object and I want to see what you can do with it! If your custom brain is any good, I'll include it in the next release. I may even offer some kind of prize for the best! :)

2) Email

You can now receive email alerts about predicted possible memory failures by copying the email.cfc into the /settings directory.

3) Logging

As with the email features, this is not enabled by default, however, there is now a complete logging tool. It includes the ability to log the service history (the general graphs you see on the Home tab of the Management Application), as well as changes to the agents (manual, automatic or both), and includes log rotation by size and/or by date.

Transfer Integration (coming soon)

So I got a message from Mark Mandel today asking me about ... wait for it ... callbacks. ;) Specifically he says he needs a callback when cache is reaped in order to write a CacheBox driven cache provider for the next release of Transfer. So I guess that's the use-case that I'd asked about on the blog here before. ;) Nobody responded to the previous blog, so I never got around to writing the code for the callback. I won't be able to work on it today - I'm in the midst of a big database migration project for a client. But hopefully I'll be able to start working on it on Thursday. :)

CF on Wheels Plugin

Mike Henke has taken the original CF on Wheels sample code that I created and turned it into a plugin for Wheels. Thanks, Mike! You can read more about it on the CF on Wheels discussion group here.

Frequently Asked Questions

Here are a couple of questions I received from Steve Bryant in email following yesterday's ColdFusionMeetup.com presentation.

Can it be used without installing the full monitor application?


The only thing you need to integrate CacheBox into your application is the CacheBoxAgent.cfc. Just copy it out of the CacheBox distribution and put it directly into your own distribution and use it from there.

The CacheBoxAgent.cfc has its own simplified caching routines built-in that mirror the default storage type in the service, but with no eviction policy. If it's unable to access the service for any reason, then it will just fall-back to using its own internal caching engine. This is the feature that provides portability to the framework, and it's a point that I had intended to clarify in the presentation, but I think I didn't make it as clear as I wanted to, I think I unfortunately kind of glossed over that in the preso. ;)

I would like to be able to delete all caches for a given table in DataMgr. Could I do that in CacheBox pretty easily?

Yes, absolutely!

This is another point that I tried to mention, but I think I glossed over during the preso. Partly because I didn't show the code - someone asked a question about deleting content and I mentioned it briefly while answering the question.

So if you use the table name in your cache name, then you can use that as a handle to remove content from that table, using % as a wildcard just like you would in cfquery. So for example,


This would expire all content for that agent where the cachename begins with "mytable.".

Presentation Recording

I somehow managed to announce this presentation for ColdFusionMeetup.com on my DataFaucet blog and onTap framework blog without remembering to post it here. D'oh!

We had a great time with yesterday's presentation. :)

We had an even dozen show up and a pleasant surprise at the end. There's a poll at the end of these meetup presentations so the people who attended can anonymously rate the presentation. It asks "was this information useful?" and the options range from 1-star (it was a waste of time) to 5-stars (yes, very much). In this case 50%, an even half of the guys who came gave me 5 stars. So I feel really good about the presentation. :) There is certainly still room for improvement in my presentation skills, but I think this is great progress.

I've also used some of the feedback from this presentation and updated the intro to the documentation for the CacheBox project to clarify the benefits of using it.

Here's the presentation recording for anyone who missed it: https://admin.na3.acrobat.com/_a204547676/p26212200/

50 Downloads in the First Week!

I just uploaded version 0.9.3. I've managed to add samples of CacheBox integration for the Mach-II framework and for Steve Bryant's DataMgr tool (a data access layer). I haven't tested either of these yet. I've also updated the documentation again and added some information about using CacheBox for singleton storage and for managing sessions with it. It's not exactly what I had hoped for in terms of samples, but it'll do. :) I'd still like to get a simple blog or something in there if anybody knows of a small one that caches its content. I haven't found one yet, they're all at least 1MB download and I don't want to add something as a sample that's larger than the CacheBox. Anyway there's a new download on the project home page.

There've been about 50 downloads so far in just the first week. I'm still looking forward to hearing what everyone thinks! :) I know Matt Gersting integrated it into FuseCache for Fusebox applications, and said that he likes the management application so much he's probably going to use CacheBox for most of his caching. So that's one in the win column. ;) Where does everyone else stand? Am I doing a good job with the documentation? Is it working for you? Have you found any bugs? Is it just so good that everyone is speechless? :)

Coming Soon!

So the CacheBox project has been up on RIAForge for a good deal of time now but I hadn't made any progress on it in several months. So this past week I finally got back to coding in earnest and have been working on CacheBox in particular, rather than on DataFaucet or the onTap framework, both of which will have updates to include the new CacheBoxAgent CFC for all their caching features. And I'm making good progress, despite the fact that this project always seems to be more complex than I expect it to be.

There is now a real management application for viewing and resetting the cache and I'm now working on forms that will allow you to set storage types and eviction policies while viewing the cache statistics. I'm doing this sort of backwards because the ideal for CacheBox is that you shouldn't need to ever manually set storage types or eviction policies, the service should be able to do all that for you. Actually because the server can check and optimize itself every minute or so, it can do a much better job of optimizing the cache than you or I or any other human-being could. But I'm putting off writing the intelligent automation portion of the service and writing the sort-of boring manual configuration portion first. Once that's done, we should be able to run and test it in manual modes before I finish writing the intelligence.

Something that's a little funny is that I'm considering releasing the very first version with a "deprecated feature" that would allow you to use cachedafter and cachedwithin, the same way you do with native query caching in ColdFusion. Both DataFaucet and the onTap framework have similar features in their current versions, however, they're based on a slightly different, more hands-on philosophy than CacheBox. What are your thoughts? Do you use native query caching in ColdFusion? Do you like the way it's handled?

Anyway, I'm looking forward to the first release and to getting lots of great feedback from all you guys and gals in the community. :) If you're feeling adventurous, feel free to pull the BER down from the SVN server, just beware that there's no documentation yet.

BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress