I just spent an hour or more that I DON'T HAVE debugging a mysterious caching issue. I suppose in some cases it might be obvious, but in this one, it was not. To sum up, we're using an XmlDataSource control generically and setting its Data property programmatically (and using an XSL--don't know if that matters).
Anyways, apparently the dang control defaults to "cache indefinitely" and won't refresh until the file it depends on changes. I guess the thing is that it doesn't look for changes when you set the Data property, so it caches indefinitely to be sure. Set EnableCaching to false, and voila, the problem is solved.
This just highlights a rule that all general APIs should follow--don't do any automatic caching. You can't account for all the ways your customers will use your stuff, so just don't do it. It's not hard to make them flip a bit to turn it on.
The opinions expressed herein are solely my own personal opinions, founded or unfounded, rational or not, and you can quote me on that.
Thanks to the good folks at dasBlog!
Copyright © 2017 J. Ambrose Little