Launch speed (seems slow)

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,

See Xojo Web 2.0 FastStart

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.

  • this is only a proof of concept, so I would encourage thorough testing if you plan to use it in production
  • The URL is up to you, you could use a single character “x” if you wanted to.
  • if you put a webserver proxy in front of the URL, the proxy could rewrite the URL so you could use the defalt “/” path.

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.

Check this line - you may need to adjust the URL to match your configuration
dim host as string = "" + 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…

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)

Apparently the handleURL event is supposed to fire once on the initial connection with an empty path, but the documetnation WebApplication.HandleURL - Xojo Documentation 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!

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:
66772 - WebResponse.SetCookie only sets one cookie

Are you using cookies?

Thankfully, not for this small app!

the queryString should be available : WebRequest.QueryString - Xojo Documentation

All working much better now - thanks for your help today Mike :slight_smile:

Same issue here folks. Just wondering if you can share the fix?

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.