473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

caching large XML files in an ASP.net application

hi all,

im currently writing an ASP.net front end to display data found in an XML
file. the XML file is quite large (700k or so), and so takes a while to
load. it will be changing around every second, so needs to be loaded at
least at that rate. at the moment, the ASP application loads the xml every
refresh - im thinking that this may cause problems when there are 20 clients
each refreshing once per second.

the solution im thinking of is to have a thread accessible to all the ASP
instances that deals with loading and refreshing the XML into a dataset. it
would do this every second and make the dataset available to all ASP
instances to read from.

how would this work? assuming you can create threads as normal in an ASP
application, how do i make it accessible to all of them? by making it
static? which applicaiton thread instance would be in charge of starting and
stopping the XML reading thread? i mean the first should start it and the
last to exit should quit it, but can this be detected? or is a timeout a
best way to quit it (not accessed in a minute -> quit). is this thread a
particularly efficient way of doing this, or would it put another
unnecessary load on to the webserver?

if i dont use a thread, whats the best way to implement the XML reading? it
would have to be a shared dataset, but only updated once every second - how
would this timekeeping be implemented by the various application threads?

thanks in advance, and sorry for the many questions!

spammy
Nov 18 '05 #1
3 1522
Spammy

sorry i haven't tried using any of the Threading classes with ASP.NET,
however you might be able to change some other parts of the application to
solve your problem?

first of all is all the data changing in the xml file? If possible i've
found it easier to split out a large xml file into several smaller files and
use xslt on them to make a kind of view of the combined data.

try seeing if its possible to use the Cache object to store the data
(however if the cache has to be cleared every second i don't think this
would give you a large benefit).

J

"spammy" <me@privacy.net> wrote in message
news:2h************@uni-berlin.de...
hi all,

im currently writing an ASP.net front end to display data found in an XML
file. the XML file is quite large (700k or so), and so takes a while to
load. it will be changing around every second, so needs to be loaded at
least at that rate. at the moment, the ASP application loads the xml every
refresh - im thinking that this may cause problems when there are 20 clients each refreshing once per second.

the solution im thinking of is to have a thread accessible to all the ASP
instances that deals with loading and refreshing the XML into a dataset. it would do this every second and make the dataset available to all ASP
instances to read from.

how would this work? assuming you can create threads as normal in an ASP
application, how do i make it accessible to all of them? by making it
static? which applicaiton thread instance would be in charge of starting and stopping the XML reading thread? i mean the first should start it and the
last to exit should quit it, but can this be detected? or is a timeout a
best way to quit it (not accessed in a minute -> quit). is this thread a
particularly efficient way of doing this, or would it put another
unnecessary load on to the webserver?

if i dont use a thread, whats the best way to implement the XML reading? it would have to be a shared dataset, but only updated once every second - how would this timekeeping be implemented by the various application threads?

thanks in advance, and sorry for the many questions!

spammy

Nov 18 '05 #2
janaka,

thanks for the response. yes, the whole xml file is changing. further all of
it needs to be made available to each client, as they would be viewing
arbitrary parts of it.

the cache object sounds ideal if the same cache is available to all loading
pages, but like you said it would need to be refreshed each second. if this
refreshing can be done in the backgroud by another thread, then it may work
out well. the question is however - can a thread be set up to do this? ive
been searching groups further and it sounds like asp threading isnt worth
the bother.

has anyone managed to create a working threading ASP application?

spammy

"Janaka" <ja****@magicalia.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
Spammy

sorry i haven't tried using any of the Threading classes with ASP.NET,
however you might be able to change some other parts of the application to
solve your problem?

first of all is all the data changing in the xml file? If possible i've
found it easier to split out a large xml file into several smaller files and use xslt on them to make a kind of view of the combined data.

try seeing if its possible to use the Cache object to store the data
(however if the cache has to be cleared every second i don't think this
would give you a large benefit).

J

"spammy" <me@privacy.net> wrote in message
news:2h************@uni-berlin.de...
hi all,

im currently writing an ASP.net front end to display data found in an XML file. the XML file is quite large (700k or so), and so takes a while to
load. it will be changing around every second, so needs to be loaded at
least at that rate. at the moment, the ASP application loads the xml every refresh - im thinking that this may cause problems when there are 20

clients
each refreshing once per second.

the solution im thinking of is to have a thread accessible to all the ASP instances that deals with loading and refreshing the XML into a dataset.

it
would do this every second and make the dataset available to all ASP
instances to read from.

how would this work? assuming you can create threads as normal in an ASP
application, how do i make it accessible to all of them? by making it
static? which applicaiton thread instance would be in charge of starting

and
stopping the XML reading thread? i mean the first should start it and the last to exit should quit it, but can this be detected? or is a timeout a
best way to quit it (not accessed in a minute -> quit). is this thread a
particularly efficient way of doing this, or would it put another
unnecessary load on to the webserver?

if i dont use a thread, whats the best way to implement the XML reading?

it
would have to be a shared dataset, but only updated once every second -

how
would this timekeeping be implemented by the various application threads?
thanks in advance, and sorry for the many questions!

spammy


Nov 18 '05 #3
You can put an object in the cache and tie it's expiration to a file on
the file system, so when the XML file changes it will trigger the
cache's expiration event, and you can reload the data and recreate the
dataset. If you store the dataset in the Application then all your
requests can access the same dataset object.

-Jason

spammy wrote:
janaka,

thanks for the response. yes, the whole xml file is changing. further all of
it needs to be made available to each client, as they would be viewing
arbitrary parts of it.

the cache object sounds ideal if the same cache is available to all loading
pages, but like you said it would need to be refreshed each second. if this
refreshing can be done in the backgroud by another thread, then it may work
out well. the question is however - can a thread be set up to do this? ive
been searching groups further and it sounds like asp threading isnt worth
the bother.

has anyone managed to create a working threading ASP application?

spammy

"Janaka" <ja****@magicalia.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
Spammy

sorry i haven't tried using any of the Threading classes with ASP.NET,
however you might be able to change some other parts of the application to
solve your problem?

first of all is all the data changing in the xml file? If possible i've
found it easier to split out a large xml file into several smaller files


and
use xslt on them to make a kind of view of the combined data.

try seeing if its possible to use the Cache object to store the data
(however if the cache has to be cleared every second i don't think this
would give you a large benefit).

J

"spammy" <me@privacy.net> wrote in message
news:2h************@uni-berlin.de...
hi all,

im currently writing an ASP.net front end to display data found in an
XML
file. the XML file is quite large (700k or so), and so takes a while to
load. it will be changing around every second, so needs to be loaded at
least at that rate. at the moment, the ASP application loads the xml
every
refresh - im thinking that this may cause problems when there are 20


clients
each refreshing once per second.

the solution im thinking of is to have a thread accessible to all the
ASP
instances that deals with loading and refreshing the XML into a dataset.


it
would do this every second and make the dataset available to all ASP
instances to read from.

how would this work? assuming you can create threads as normal in an ASP
application, how do i make it accessible to all of them? by making it
static? which applicaiton thread instance would be in charge of starting


and
stopping the XML reading thread? i mean the first should start it and
the
last to exit should quit it, but can this be detected? or is a timeout a
best way to quit it (not accessed in a minute -> quit). is this thread a
particularly efficient way of doing this, or would it put another
unnecessary load on to the webserver?

if i dont use a thread, whats the best way to implement the XML reading?


it
would have to be a shared dataset, but only updated once every second -


how
would this timekeeping be implemented by the various application
threads?
thanks in advance, and sorry for the many questions!

spammy



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dave Griffiths | last post by:
Hi all Very new to JavaScript, I am trying to cache a number of images as the page loads, is there a max number of images or memory usage before the browser stops caching. My PC has 1G ram so...
5
by: michaeltorus | last post by:
Is the only way to cache data in Memory, such as a Dom Document, to use System.Web.Caching namespace? I can't seem to find anything else, but what if you want to cache something in memory and you...
1
by: Kevin Burrowes | last post by:
I need to implement caching for a large enterprise application and we are planning to use the newest Caching Application Blocks. (Enterprise Library Jan. 2006) We want to cache Business Entities...
5
by: Raj | last post by:
What is the purpose of file system caching while creating a tablespace? Memory on the test server gets used up pretty quickly after a user executes a complex query(database is already activated),...
6
by: onnodb | last post by:
Hi all, While working on an Access UI to a MySQL database (which should be a reasonable, low-cost, flexible interface to the DB, better than web-based, much less costly than a full-fledged .NET...
1
by: Aryan | last post by:
Hi, I have problem related to Caching of data. I am reading large xml file and putting this xml in dataset, since this dataset will contain many datatable's inside. And each datatable might be big...
6
by: Phil Sandler | last post by:
All, I am designing a system that will involve an IIS/ASP.Net application server. The main purpose of the application server will be to load large amounts of static data into memory and do fast...
7
by: mark4asp | last post by:
How can I prevent Caching of JavaScript and CSS files ONLY when I deploy a new application? I only want to force a refresh the first time the client uses the new build. For instance, I'm told I...
12
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I'm using ASP.Net with an UpdatePanel. When the screen is exercised via a Web Test, the Web Test shows that the AJAX scripts are downloaded for every partial post back. My impression was that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.