There's two issues in your problem statement:
- A cache is a subset of the larger data to server files that are accessed more frequently. You have to invalidate low hit rate cache entries or you will consume all your resources.
- Azure Blob storage is designed to serve up your blob's bytes over HTTPS with high speed, reliability, and scalability.
By copying your blobs into your database, you are simply duplicating data. I highly doubt serving from the database is faster than having Azure blob storage serve the data for you. While databases can store binary data, that's not really their main use, so it is rarely optimized as storage mediums designed from the ground up for that purpose.
I highly recommend that you examine the ways that you have designed your application to find where it is causing bottlenecks. If you need to have your application as a proxy to the data, make sure of the following:
- Do not read the whole blob as an array of bytes--it wastes memory and can cause massive garbage collections
- Make sure you stream the bytes from the blob storage stream to the response stream
- Design around passing single use URLs (Azure storage can do this), and let the browser pull the data directly
- Look at the differences in how you are handling binary data in the database to how you are handling it in blob storage. Your algorithm may need to be optimized
In short, make sure you understand what makes Azure storage "slow". If you are testing locally on your machine and your test database is local on your machine, you are artificially penalizing Azure storage.
Granted, I come from an AWS background, and AWS S3 is much faster than serving binaries from an RDS database--particularly at scale. Microsoft is also a smart company, I'm sure the Azure storage is at least close to S3 in performance and scalability.