asp.net shall i cache a 5 kb file?
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 t开发者_StackOverflow中文版here?
I am concerned because avatar handler gets quite alot of requests.
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.
精彩评论