Hi, I guess there’s a reason why web apps take a while to load before anything happens.
A web app with a simple GoToURL in its session Opening event takes 2-3 seconds to reach after calling the page.
It’s running as a standalone webapp with an SSL cert on a fairly beefy MacPro.
Any thoughts on how things can be sped up?
Many thanks,
Dave.
Mike_D
(Mike D)
November 25, 2021, 2:21pm
2
Thanks Mike - but we can’t pass /fast-cache.html to the app as we need to pass some other arguments and require the url to be as short as possible.
what xojo version ? use 2021r3 to get fast webpage loading
OK Mike, but testing as-is, I get “File not found” with /fast-cache.html added to the url. In debug, it does catch the initial select case, but then bails out on the subsequent handlespecialURL.
That’s what I’m using Jean-Yves.
Mike_D
(Mike D)
November 25, 2021, 3:15pm
8
Check this line - you may need to adjust the URL to match your configuration
dim host as string = "http://127.0.0.1:" + str(app.Port) + "/"
You could also check Console.log to see if there are any errors being thrown.
That’s already there and in debug confirms port 8080 for debug run
When it hits
Dim h As String = u.SendSync("GET", host)
It fires another handleSpecialURL event but with no parameters to catch the select case statement and bails out to page not found…
Mike_D
(Mike D)
November 25, 2021, 3:25pm
10
Interesting - I’m not seeing that behavior - on my test, using fast-cache does work and the xojo webapp loads properly.
However, I am seeing what appears to be an extra HandleURL event where the path is blank. Not sure if this is a Xojo bug, and if it’s new in 2021 R3 ?
In my case, I ignore this request, and the app loads normally.
Here’s what the blank request looks like:
Edit to add: no, I see identical behavior on 2021 R2.1 and R3, so this is not a difference.
Right, I’ll give that a go Mike (and yes, I’m on 2021r3)
Mike_D
(Mike D)
November 25, 2021, 3:34pm
12
Apparently the handleURL event is supposed to fire once on the initial connection with an empty path, but the documetnation https://documentation.xojo.com/api/web/webapplication.html#webapplication-handleurl is a bit confusing. I’ve asked for the documentation to be clarified.
All I needs to figure out now is how to process a QueryString ?var=value after it’s done all the other stuff!
Mike_D
(Mike D)
November 25, 2021, 4:07pm
14
my fast-start example doesn’t pass along cookies or the queryString, so you would probably need to add those to the initial WebResponse.
However, I just found what appears to be a bug in WebResponse where it can’t set more than one cookie:
<https://xojo.com/issue/66772 >
66772 - WebResponse.SetCookie only sets one cookie
Are you using cookies?
Thankfully, not for this small app!
Mike_D
(Mike D)
November 25, 2021, 4:13pm
16
All working much better now - thanks for your help today Mike
Same issue here folks. Just wondering if you can share the fix?