Hi @vkarthick ,
I wonder if you can use Context hub that is provided OOTB by AEM to store client context. Client contexts are often used in a website implementation in order to achieve a certain amount of personalization of the contents of a website.
This framework enables for multiple functionalities such as targeting, segmentation, geolocalization, cart management, only to cite a few, and can be easily customized to provide more.
But, still if you would like to go through indexDB way then below article might be helpful for you:
https://hacks.mozilla.org/2012/02/storing-images-and-files-in-indexeddb/
Thanks
Tarun