Added Page on Very Slow

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
jangle
Veteran Member
Posts: 78
Joined: 2020-01-18 17:41

Added Page on Very Slow

Post by jangle » 2020-10-05 21:35

Hello all,

I have added a page to my site to post some charts. I used the code from the appgini website tutorial.

Code: Select all

<?php
    define('PREPEND_PATH', '../');
    $hooks_dir = dirname(__FILE__);
    include("$hooks_dir/../defaultLang.php");
    include("$hooks_dir/../language.php");
    include("$hooks_dir/../lib.php");

 /* grant access to the groups 'Admins' and 'Data entry' */

 include_once("$hooks_dir/../header.php");

  $mi = getMemberInfo();
 if(!in_array($mi['group'], array('Admins'))){
     echo "Access denied";
     exit;
 }
 echo 'Welcome to the SERP COVID19 Live Dashboard';

 include_once("$hooks_dir/../footer.php");


?>

The page works great locally. But on the server in takes minutes to load.

If I just post the page without the code above it loads fine, as does the charts. Of course I want to use the code above to limit access and to have to page look like my others.

Anything look wrong with the code? Any thoughts?

Thanks in advance.

Jim

onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 662
Joined: 2019-05-21 22:42
Contact:

Re: Added Page on Very Slow

Post by onoehring » 2020-10-07 10:15

Hi,

for me the code looks pretty much ok.
Are there some things blocked in your browser (extensions that do that)?
Are you using some external scripts to render your graphics? This might be the bottleneck as well - but if you mean, your graphics render fine without the code you present here I would probably rule that out.

Olaf
Some postings I was involved, you might find useful:
Backup your database (viewtopic.php?f=4&t=3341); Improve security (viewtopic.php?f=4&t=3168); Field Permissions (viewtopic.php?f=4&t=3308); Custom (error) message (viewtopic.php?f=7&t=1740&p=10871#p10906); Audit Log (viewtopic.php?f=4&t=1369&p=10407); Two Factor Authentication (viewtopic.php?f=7&t=3306&p=11478); Add 2nd SAVE CHANGES button (viewtopic.php?f=2&t=3242&p=11104); Place a search on details view (viewtopic.php?f=2&t=3479&p=12484#p12484); Column-Value-Based-Permissions (viewtopic.php?f=4&t=3498)

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 815
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Added Page on Very Slow

Post by jsetzer » 2020-10-07 10:33

Hi,

I agree with Olaf: the custom page looks fine.

I assume that you have already checked if all additional scripts could be loaded and no more (red) errors appear in the console.

If this issue is related to lazy loaded scripts or other resources, it might help if you open the developer tools in your browser and check on the "Network" tab which components take the most loading time.


This is just an example of a random page:
chrome_4gnQQbuqQj.png
chrome_4gnQQbuqQj.png (83.99 KiB) Viewed 195 times
Kind regards,
<js />

jangle
Veteran Member
Posts: 78
Joined: 2020-01-18 17:41

Re: Added Page on Very Slow

Post by jangle » 2020-10-07 14:00

Thank you both very much.... I will try your suggestions.

FYI with out that code the page loads fine....

Jim

jangle
Veteran Member
Posts: 78
Joined: 2020-01-18 17:41

Re: Added Page on Very Slow

Post by jangle » 2020-10-07 14:15

Hmmmm

I get find this

GET https://******.com/hooks/hooks/AppGiniHelper.min.js net::ERR_ABORTED 404 (Not Found)

But the AppGiniHelper.min.js is in hooks...

Jim

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 815
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Added Page on Very Slow

Post by jsetzer » 2020-10-07 15:03

Did you notice /hooks/hooks?
I guess there is something wrong with your include path
Kind regards,
<js />

jangle
Veteran Member
Posts: 78
Joined: 2020-01-18 17:41

Re: Added Page on Very Slow

Post by jangle » 2020-10-07 15:30

Yes I did notice that. I am going to dig into to find that.

Thanks

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 815
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Added Page on Very Slow

Post by jsetzer » 2020-10-07 15:39

According to Chapter "Tips / Custom pages" in the docs https://appgini.bizzworxx.de/products/j ... tegration/, can you please try the following include in hooks/header-extras.php

Code: Select all

<script src="<?=PREPEND_PATH?>hooks/AppGiniHelper.min.js"></script>
chrome_wmDDoMF8uu.png
chrome_wmDDoMF8uu.png (19.11 KiB) Viewed 173 times

Hope this helps with the include-problem you have reported. I'm curious if this modified include helps with the loading-delay problem,
Kind regards,
<js />

jangle
Veteran Member
Posts: 78
Joined: 2020-01-18 17:41

Re: Added Page on Very Slow

Post by jangle » 2020-10-07 17:04

Thanks jsetzer

So this did work,

Code: Select all

<script src="<?=PREPEND_PATH?>hooks/AppGiniHelper.min.js"></script>
It still took a ling time but it did find hooks/AppGiniHelper.min.js

I moved my file out of hooks and removed the ../ in the paths and it works great....

So thanks for your and Olaf's help, problem solved.

Jim

Post Reply