Optimizing Page Load Speed

Hello,

I’m trying to speed up the content loading on my pages. E.g currently, I have a workflow set up like this: IF the page is loaded and the current user is logged out, THEN go to page login.

Would it be more efficient to structure the workflow as: If the user is logged out, THEN go to login? Or does this not affect the loading speed?

Let me know if you need any more changes or additional information!

Are you using a “When page is loaded” event? If so, make sure you put the condition on the event and not the go to page action and this will result in a 302 redirect rather than a 200 redirect. This means the redirect comes from the server rather than the client and the page will not be loaded at all. Feel free to post pics of your workflows if you’re unsure

Yes. Like this:


From my point of view, you should set an event User is logged out instead of using on page is load. It’s not really faster, but it will apply at any moment if the user is disconnected, not just validate this on page is load.

1 Like

The first one looks fine. Are you experiencing that the redirect is slow? If so, what’s the url of the page?

The second one I don’t understand. Why are you using actions to show the elements rather than making them visible by default or using element conditions?

I would do both. I don’t think the user logged out action causes a 302 redirect so I’d only use that for when users are logged in on page load and then log out

Because I experienced that the content on the page was displayed before the user was verified as logged in or verified to actually have access to the page. I redirect users without the proper access to the login page or a 404 page.

Did you set privacy rules? This is what you need to do first. No content from DB will show if user is logged out with correct privacy rules

Actually I just tested this and the user is logged out event does cause a 302 redirect. So this is a better solution when wanting to redirect logged out users

1 Like

Yes. But only on data. Not on design-element like the header/footer/left navigation…

That shouldn’t be the case…what’s the url?

I conducted a new test and set the header, navigation, and footer to be visible upon page load. I added only two workflows:

1.	When the page is loaded and the current user is logged out: Redirect to the index page.
2.	When the page is loaded and the current user’s access does not include this page: Redirect to the 404 page.

This way, the header, footer, and navigation are shown before the user is redirected if they don’t have the appropriate access.

It´s restricted, you will not have access without an account.

Do you mean that the app is password protected?

You can use this site to check your redirects: Redirect Checker | Check your Statuscode 301 vs 302

Yes it’s password protected… And my test is in dev-mode not live.

This.

“Go to page actions” on “page loaded” and “user logged out” events will immediately redirect users before any content is loaded.

There are caveats.

  • The event workflows should not contain any other action other than the go to page.
  • keep the conditions simple so it doesn’t have to ping the backend to test the condition. Eg. Checking a URL parameter

Absolutely. I prefer to use User logged out and go to page because of that. No condition, one action. But also because this apply automatically if user is logged out. Not just a check on page is load. Often, this is included un header reusable element.

1 Like

It´s still showing the elements before it redirect the user.

Your conditions require data to load. So it continues doing it’s thing.

If you want to keep data loading down while running a check, an alternative solution is to make a page that acts as a gatekeeper. That page just needs to load whatever you require then redirect your user accordingly.

If you need some SEO you can just attach your content type to the page. That’s how my index works for one of my apps. I learned this from the Flusk team.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.