> o Control Caching Resource Usage
>   Change resource caching to limit cache size and expire
>   least-recently-used.  This is needed to prevent Vel from
>   sucking up RAM uncontrollably for content-centric or
>   other sites that may use #include() or #parse()
>   extensively.

I would like to help add this feature to Velocity.  Has there been any more
discussion about this or is anyone already working on an implementation?  I can
think of two immediate approaches to doing this:

A) Replace the Hashtable in ResourceManager with a simple LRU cache
implementation which enforces a (configurable) maximum # of resources.

B) Make the cache implementation switchable to allow for a variety of
implementations, like LogSystem.  E.g.:

   interface ResourceCache {
      Resource get (String resourceName);
      void put (String resourceName, Resource resource);
      void clear ();
   }

Ideally the Resource cache would be able to enforce a byte-size limit but this
would require some complex changes across the resource loading code and the
template AST.  That may not be practical right now.
-- 




-- Mike McDonald <[EMAIL PROTECTED]>
   http://www.kelek.com
     Web Samurai
     Freelance Programmer/Consultant
     Developer, http://www.Worldisround.com

Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

Reply via email to