I have a worker role set up for dedicated caching. On application start up I'd like to load the cache from a database (ideally in the OnStart() method in the WorkerRole/RoleEntryPoint). I haven't been able to find how to add an object to the cache from within the dedicated cache project (I can use the cache from other roles without issue).
Does anyone know if it would be best to create a new DataCache() object like from other projects, or is there an internal method that would be faster? Eventually I may have a large amount of data to load so I'd like it to be as fast as possible (also hoping to minimize bandwidth across roles). Anyone have any tips or best practices for the initial load of cache in Azure? I've been searching for a while and haven't come up with anything.
Thanks!
Cache was not yet available (null DataCache, threw error on attempt to initialize) in the OnStart() or Run() methods in the WorkerRole on the dedicated cache. I also tried it on the WebRole for one of the web projects and that didn't work either.
I ended up using the Application_Start method in the Global.asax of one of my web roles and that worked. I think this is an OK solution because I'd be waiting anyway before moving from staging.