Page 1 of 1

Added Page on Very Slow

Posted: 2020-10-05 21:35
by jangle
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

Re: Added Page on Very Slow

Posted: 2020-10-07 10:15
by onoehring
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

Re: Added Page on Very Slow

Posted: 2020-10-07 10:33
by jsetzer
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 2032 times

Re: Added Page on Very Slow

Posted: 2020-10-07 14:00
by jangle
Thank you both very much.... I will try your suggestions.

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

Jim

Re: Added Page on Very Slow

Posted: 2020-10-07 14:15
by jangle
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

Re: Added Page on Very Slow

Posted: 2020-10-07 15:03
by jsetzer
Did you notice /hooks/hooks?
I guess there is something wrong with your include path

Re: Added Page on Very Slow

Posted: 2020-10-07 15:30
by jangle
Yes I did notice that. I am going to dig into to find that.

Thanks

Re: Added Page on Very Slow

Posted: 2020-10-07 15:39
by jsetzer
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 2010 times

Hope this helps with the include-problem you have reported. I'm curious if this modified include helps with the loading-delay problem,

Re: Added Page on Very Slow

Posted: 2020-10-07 17:04
by jangle
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