Hi guys,
Finally I took middle approach.
I am having image object in code behind. For shwoing that in main web page.
I am adding that object in Cache with one random key (in my case GUID). Then I am generating URL such as ~/GetImage.ashx?id=[GUID]
When this URL is accessed an image from cache will be stored.
Note:
- I am adding image to cache with self expiration set to absolute 2 mins. to ensure cache will be empty without manual intervention and there is enough time for other processing to happen.
- Used Cache over Session for same reason mentioned in point 2, where i may have to manually remove it.
Of course I am still open for better solution.