External Files Caching

Topics: Caching Application Block
Jun 21, 2010 at 3:07 PM

Hello ,

Suppose i have  a custom XML file and i want to cache its data , so that i don't have to access the same again by loading and all that stuff.

I want to implement the same as that i will provide the path for the file in web.Config and the enterprise library 5.0 will load the same in Cache at Application start up.

Is it possible with Enterpriose Library 5.0 ? if yes then how?

regards

Shamajit

 

 

Jun 22, 2010 at 8:27 AM

Hi Shamajit,

Yes this is possible but I'm afraid you'll have to do some of the codes by yourself if you would want to cache your data. Entlib's Caching Block does not have a built-in way of automatically iterate through an XML file then add it's data in the Cache. You'll have to manipulate this by yourself and define it from where it is located. Anyway, I believe you are on the right path of using Caching Application Block since as you stated the main problem you would want to addressed is the repeated access/load/transfer of data.

For more information on adding/retrieving data in the Cache you can check the following documentation http://msdn.microsoft.com/en-us/library/ff664621(v=PandP.50).aspx (adding to cache) and http://msdn.microsoft.com/en-us/library/ff664725(v=PandP.50).aspx (retrieving items from cache)

Gino Terrado
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

 

 

Jun 22, 2010 at 11:28 AM

Thanks Gino ,

Actually i want to have the functionality of ConfigurationManagement Application block ( built on .net framework 1.1 ) in Enterprise Library 5.0 (.Net Framework 3.5 ) . Is it integrated in Enterprise Library 5.0 ?? If yes then how to implement the same ? I am ready to do some coding for the same ?

regards

shamajit

 

 

 

Jun 22, 2010 at 11:58 AM

Personally, I haven't really used ConfigurationManagement Application block. The only thing I understand what it is for is basically for this purpose "The purpose of the Configuration Management Application Block is to provide simple and efficient read and write access to application configuration data.". If this type of functionality is what you're looking in EntLib 5 then I think what you need is to use EntLib 5's Fluent Configuration API, check the documentation (http://msdn.microsoft.com/en-us/library/ff664363(v=PandP.50).aspx) and let me know if this suit your needs. 

Gino Terrado
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com