Hi Ashutosh,
For Media Files (SiteName/media) and Attachments (SiteName/files) you don't need to add settings in your web.config. Typically it is enough to configure Settings -> System -> Performance -> Client cache (minutes), we usually set it to 1 year as existing images with the same URL are very unlikely to change. Also, have a look at the documentation article re client caching, it may give you more info.