I've implemented caching on a file (XML) which gets sent to the graphs controls to render it. However, I was told to implement caching in a way that can be easily switched on and off (meaning setting a value in web.config).
Is there a way I can turn caching on and off depending on a value in a web.config file? Thank you lots!
@oded the code you supplied doesn't fit in my scenario because I'd have to rewrite existing code for instance:
if(bool.parse(confi.... == "true"){
if(Cache[x] == null){
load the XML document and insert it into the Cache object }
else{
get the xml document from the Cache object. } }
else repeat myself by reloading the document from object.
I'm sure there's got to be a better solution to this.