I am implementing Azure In-Role Caching for a Web API Web Role that I have. I would like to be able to Cache the BlobReference for specific blobs that do not change often. Here is the code I am using to get the BlobReference. The items I am getting are zip files that are of type CloudBlockBlob
public ICloudBlob GetBlob(string containerName, string blobName)
{
CloudBlobContainer container = GetBlockBlobContainer(containerName);
ICloudBlob blob = container.GetBlobReferenceFromServer(blobName);
return blob;
}
However when I try to Put the item in Cache, it says that CloudBlockBlob is not serializable. Since I cannot modify that class to be serializable, is there a work-around for this? If not, what is the preferred method to cache the blob metadata for blobs that do not change often?