I'm planning to build a content-based site (hundreds of articles) using Tomcat/JSP. My first inclination was to put the content in a database like MySQL.

Ryan Breidenbach

No, there is really no reason why you can't write your own caching classes. However, it would be easier to write your own classes as an aggregation of existing collection classes. Obviously, a good place to start would be the Java Collection APIs. Also, you may want to look Object Space's JGL Libraries. The library is free, and has an extensive set of collection classes. One which may suit your purposes is the Queue class.

As for the implementation, you probably don't want to cache all your articles. Perhaps the two criteria you would want to base the caching algorithm on are the frequncy in which the article is accessed and when it was last accessed. This would allow you to keep your most current and most popular articles cached.

One other thing I would caution you on - be sure your cache has a mechanism that allows you to refresh the cache as needed - perhaps a refresh() method that would clear the cache and start fresh.