views:

30

answers:

1

im using a handler to serve user avatars. if there is no avatar set its reading noavatar.jpg from file system and binarywrite to the client.

is it good idea to cache this 5kb noavatar.jpg to memory and serve from there?

I am concerned because avatar handler gets quite alot of requests.

+1  A: 

I would say Yes, cache it. The only price here is the little bit of code you have to write. After that the Cache has the option to drop it, so your app can dynamically adjust to system conditions.

Henk Holterman