[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Images from database



(long rant about database-served images deleted)

Doesn't WOResourceManager in WO4 address most of those concerns?  If you use WOImage with the key attribute, the images are cached on the server by WOResourceManager.  It enables client-side caching (the URL's are identical when they should be), and since it's an application-wide cache, it's shared between sessions.

One drawback to WOResourceManager is potential memory bloat.  But you can manage that yourself with flushDataCache and removeDataForKey:session: (note the session argument is currently unimplemented).

On a side-note, an interesting gotcha of WOResourceManager is what to use as the image's cache key.  If your database images are changing, the key should be something like a modified date or a checksum.  If you use the same key and the image changes, you risk inadvertent client-side caching.

--
Cliff Tuel -- ctuel@apple.com
Enterprise Technical Support / Apple Computer, Inc.