Moving from Asp to Asp.Net and I am experiencing long load times for my pages. Obviously, the first load takes extra time while the page is being compiled, and then all subsequent accesses to the page are quick as expected. However, if I wait a while (say an hour) and access the page, the compile delay occurs again.
There has been a lot of discussion on the board about aspx page load delays, but I've not seen anything describing the issue I'm seeing.
Below is the code for one of my pages. On my system, load time for this page during compile is 6 seconds while a refresh is under 1 sec.
Any thoughts?
There has been a lot of discussion on the board about aspx page load delays, but I've not seen anything describing the issue I'm seeing.
Below is the code for one of my pages. On my system, load time for this page during compile is 6 seconds while a refresh is under 1 sec.
PHP Code:
<!-- LogNote.aspx - mfisher, 04Jan2009 -->
<%@ Page language="vb" %>
<script runat="server">
Dim hs As Scheduler.hsapplication
Dim LogDisplay As String
Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs)
' for use with the HS web server
hs = Context.Items("Content")
If hs Is Nothing Then
' maybe running under IIS
hs = Global.ASP.global_asax.hs
If hs Is Nothing Then
Response.Write("Could not get access to HomeSeer object, is HomeSeer running?")
End If
End If
Dim LogBuffer() As String
Dim LogItems() As String
LogBuffer = Split(hs.LogGet(), vbCrLf)
Dim i As Integer
LogDisplay = "<table border=""1"">" & vbCrLf
LogDisplay &= "<td><b>Time</b></td><td><b>Class</b></td><td><b>Entry</b></td>" & vbCrLf
For i = (UBound(LogBuffer) - 20) To (UBound(LogBuffer) - 1)
LogItems = Split(LogBuffer(i), "~!~")
LogDisplay &= "<tr><td>" '& Ubound(LogItems) & ": "
LogDisplay &= LogItems(0) & "</td><td>"
LogDisplay &= LogItems(1) & "</td><td>"
LogDisplay &= LogItems(2) & "</td></tr>" & vbCrLf
Next
LogDisplay &= "</table>" & vbCrLf
Dim Command As String = StripCrLf(Request.Form.Item("Buttons"))
Dim LogClass As String = Request.Form.Item("LogClass")
Dim LogNote As String = Request.Form.Item("LogNote")
Select Case Command
Case "Save"
If (LogClass <> "") Or (LogNote <> "") Then
hs.WriteLog(LogClass, LogNote)
End If
End Select
Response.Write(hs.GetPageHeader("Log Note", "", "", False, False, Nothing, Nothing, Nothing))
Response.Write("<br><hr>")
End Sub
Function StripCrLf(ByVal Cmd As String) As String
If InStr(Cmd, vbCrLf) Then
StripCrLf = Left(Cmd, Len(Cmd) - 2)
Else
StripCrLf = Cmd
End If
End Function
</script>
<form name="lognote" method="post" action="LogNote.aspx">
<h5>Create an entry in the HomeSeer log.</h5>
Class:
<input class="formtext" type="text" size="20" name="LogClass" value=""/>
Entry:
<input class="formtext" type="text" size="60" name="LogNote" value=""/>
<input class="button" type="submit" name="Buttons" value="Save"/>
</form>
<%
Response.Write("<hr><font size=""30""><b>Last 20 log entries:</b></font><br><br>")
Response.Write(LogDisplay)
Response.Write(hs.GetPageFooter())
%>
Comment