Many options, but what you are primarily looking for here is the ability to
cache a file
until it changes and needs to be reloaded. The http caching logic allows for
this by
adding an item by key that additionally has expiration timeouts or dependencies.
[C#]
public object Add(
string key,
object value,
CacheDependency dependencies,
DateTime absoluteExpiration,
TimeSpan slidingExpiration,
CacheItemPriority priority,
CacheItemRemovedCallback onRemoveCallback
);
You can set the XML file as your dependency on the object so that whenever the
file
changes your callback gets run. If this item is the same per user you can use a
key
that is global to the application and not bother using Session (since you are
duplicating
the XML in that case across multiple users, which is bad). Or if the XML is
different
per person, you can use a key based on their SessionID.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers [quoted text, click to view] "Neil" <ndglover@urbanscience.com> wrote in message
news:41D92985-1B91-4797-B065-C5D0B4FD6577@microsoft.com...
> Hi,
>
> I'm overloading the onInit event in my custom page class and checking the
requested Id in the Url is present in my XML file and also checking a couple of
attributes for that Id. I'm using the XMLDocument.Load method and the
SelectSingleNode method to check for my Id. I'm wondering whether it would be
better to store the XML document in the session state rather than use the load
method each time? The XML file that is used could change at any time so it will
not always be possible to read from the session, sometimes I will need to
repopulate the session first by using the load method. I'm not sure what the
overhead with the load method is though.
[quoted text, click to view] >
> Any one got any ideas suggestions? FYI the xml file is approx 80KB