How do I get from dynamic aspx to static html

R

Rich S

I created this neat little .net site which tracks the inventory of my
little widge company giving me real time inventory counts and whatnot.
It uses your standard code that calls a stored procedure and loads up a
datagrid and works really well.

It occurred to me that since my database inventory is only updated once
per day at 6:30 am having this dynamic query and page generation is
overkill and I really just need to save the output to some static html
page. (or static aspx page with the data hard coded in).

This would save alot of processing and probably make the site very
quick to respond to the thousand upon thousand requests for this
information from my users.

So my question is how do I get from the aspx page with the datagrid to
the html page thats just a table with hard coded data?

I'm guessing there's no function called "save as html" from a web form
that would do this for me and I am stuck writing this out manually?

Once I have the output html stored in some file (like inv011706.html)
is there a way I can import this from my default.aspx file based upon
the current date?

Thanks
 
G

Guest

What you can do is to create a table inside your database that would hold the
time of the last update and the results of your query in a string format
(something like output from Dataset.WriteXml()) and then have your page check
the timestamp in this table. If the last update time was prior to 6:30 am and
now it is after - populate your dataset with the values from your query and
save the xmlstring into this new table, otherwise - populate your dataset
with ReadXml() method.

HTH
 
R

Rich S

I understand what you are saying thanks.

I might build the data and write it out to an xml file and import that
upon demand.

I'm guessing that performance wise a html file would load the quckest
and performing the query and building the grid would be the slowest, so
this method would be leaning towards the faster side of that range.

Plus it gives me the benefit of using the grid for paging which I would
have a tough time doing in html pages.

Thanks, I'll give it a try.
 
G

Guest

Rich,
why not just Cache the returned DataSet with an absolute expiration of "XX"
hours?
Your code would look to see if your DataSet is still in Cache and if not, it
would get a new one and stick it there.
That's what Cache is for.
Peter
 
R

Rich S

oh even better. I didn't realize you could do that. That works for all
users ? Well I'll read up and find out.

Thanks
 
G

Guest

Peter,

Definitely, Cache is a better option in a single server environment, but
what about a Web Farm - from what I understood the initial data retrieval is
relatively costly..

I am not suggesting that Cacheing is a no-no (I am quilty of caching
myself), but its use has to be evaluated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top