Welcome to WebmasterWorld Guest from 54.144.48.252

Forum Moderators: ocean10000

Message Too Old, No Replies

converting generated asp code into html

     
9:41 am on Feb 28, 2006 (gmt 0)

5+ Year Member



hey

I have been searching for a solution for this problem for hours now and unfortunately I havent found anything which could help me...

What I want is:

I have got an .asp Page which has a high amount of data which is taken from a sql database. It takes about 30 to 40 seconds to display the results and thats way too long... What I want to do know is saving the html code which is generated for the clients on the server as a static html file...The fact that the html site will be static is no problem because the related asp site gets very very few updates...

Is there any possible way to realize this? I know I could write every line in a html file but isn't there a possible solutio for saving ALL the code AT ONCE?

thanks

12:04 pm on Feb 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Look into using VBScript's FileSystemObject to create an output file which you can save your data to. Once it's saved, you can then paste that code into your site file.
12:29 pm on Feb 28, 2006 (gmt 0)

5+ Year Member



I already know that this is possible... Actually I wanted to know if it is possible to do this without having to save every line in a text file.

Hm... I thought about using the server.buffer object. Is there a possibility to get access to the information which is cashed in this buffer object?

12:37 pm on Feb 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could save the HTML as a string in the Application object.

You probably don't want to save the html as an actual page because this means giving IUSR_computername (the anonymous browser account) write permissions in a directory

12:44 pm on Feb 28, 2006 (gmt 0)

5+ Year Member



you're right. I dont wanna give anyone write-permissions for the server...

Hm if I would do it the way you propose, I would have to change the string in the application object manually everytime I made some changes/updates to the asp file right?

I'd like to realiz it the way that the static html code is always loaded especially anyone who has admin-rights changed something in the database. In this case the .asp script should run again and the new string should be saved as static html until the next changes. etc

1:54 pm on Feb 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you running SQLServer? You could have an exec in SQL Server that runs a Visual Basic program that writes the HTML page. That way you just need to give the SQLServer Agent some write permissions.
4:25 pm on Feb 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Second what iguana sez... I've got a couple of sql server tasks that build static web pages for me every hour. Those static files get wrapped with the standard template and nobody ever knows the difference.
5:41 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



Why not use wget to save the page to a html file?
2:47 am on Mar 1, 2006 (gmt 0)

10+ Year Member



You could save the HTML as a string in the Application object.

If this is alot of data, the Application Object was not intended to be used as a repository for a 'large amount of data'. How much data are we talking about?

If there is alot of data (MB's?) What's taking the most time?

1) Reading the Data from DB
2) Rendering the HTML
3) Downloading the text (how much content? MB's?)

The reason I ask is if your SQL read is taking more than a few seconds, then there's a design issue in the Database, perhaps simply an Index needs to be added to a table. SQL can return thousands of results from multi-million record tables very quickly if they are designed and indexed properly.

If the rendering the HTML is taking too much time then Caching ASP Content [msdn.microsoft.com] will do what you need.

If you are downloading 2MB worth of text then your 30-40 second rendering is slow due to the amount of data you are pushing to the client.

Have you done a diff on the Ticks at the beginning of the page and then at the end (ie: how long process/rendering takes).

 

Featured Threads

Hot Threads This Week

Hot Threads This Month