xtim
Tuesday, September 23, 2008
 
Caching nulls
Some of our pages don't have associated links or wordmaps (full-page images, for example).

Our new S3StorageManager used to return nulls to indicate that there was no such information - this has the drawback that while EHCache can store nulls as cache values, they can't be persisted to disk (as null is not Serializable). So after every restart the service would have to contact S3 again to establish that there was no wordmap for a particular page.

We're now returning empty byte arrays instead - these have the same meaning to the consumer of the information and can be cached between application shutdowns. Speed, speed...

T

Labels: ,


Comments: Post a Comment

<< Home

Powered by Blogger