Ahmad

Website so Slowly when visit at first time

Recommended Posts

I'm building a site and i noticed that loading time is very slow when we enter the site address for the first time. It takes about 1 minute or more  just to start loading files and displaying the content. 

However, after that period it's very fast and everything is ok. Once the page(s) is/are loaded, i can refresh them quickly and without any delay.

any one faced like this problem? and what can i do to resolve it.

more details:

ProcessWire 3.0.80

hosted type: VPS

this message appear in admin dashboard: " Warning: your server locale is undefined and may cause issues. Please add this to /site/config.php file (adjust “en_US.UTF-8” as needed): setlocale(LC_ALL,'en_US.UTF-8');"

The site: http://almanassah.net

Share this post


Link to post
Share on other sites

Many of the images are taking a long time to load, for example,1021701976_1-1.1140x760.png takes 12.64 seconds.

You can add 

setlocale(LC_ALL,'en_US.UTF-8');

to your /site/config.php to remove that error. Use whatever locale is appropriate for you.

[edit]
You can use the browser dev tools > network tab to determine loading issue. It will help eliminate that issue should others exist.

Edited by rick
  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, rick said:

Many of the images are taking a long time to load, for example,1021701976_1-1.1140x760.png takes 12.64 seconds.

 

I agree with u, but the problem why it slowly when download the images, if u can see now i remove the slider it's the big images, now the website faster.

the really problem if u notice the logo it's take 1.1 minutes to full download, u can see the picture i attached. and the size of logo just 324 Byte.

 

 

2017-11-02_164219.jpg

Share this post


Link to post
Share on other sites

All of the resources, css, js, images, and fonts are taking quite a while to load.

What type of hosting service is this site using, shared?

I am not familiar with modernizer. Can you temporarily disable it and see if that helps any?

I'm just thinking out loud about eliminating a possible cause one at a time.

  • Like 1

Share this post


Link to post
Share on other sites

What DomContentLoaded mean?

and why it's talk 27 second in my website ? how can reduce it.

another question i notice my website doesn't showing any content until it finished load all content hidden. how can resolve that?

7 minutes ago, rick said:

All of the resources, css, js, images, and fonts are taking quite a while to load.

What type of hosting service is this site using, shared?

I am not familiar with modernizer. Can you temporarily disable it and see if that helps any?

I'm just thinking out loud about eliminating a possible cause one at a time.

i use vps

Share this post


Link to post
Share on other sites

 

10 minutes ago, Ahmad said:

What DomContentLoaded mean?

and why it's talk 27 second in my website ? how can reduce it.

another question i notice my website doesn't showing any content until it finished load all content hidden. how can resolve that?

i use vps

As far as the content not displaying until it loads, it might be due to your apear.js file. It appears that modernizer is not defined (since you removed it), and your plugins.js file is depending on modernizer.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks i removed modernizer and now the website better.

and i have one question, if the arrays make website slow ?

 

Share this post


Link to post
Share on other sites

Try to load JS+CSS without AIOM. It takes over 3 seconds to load... Also, load the Font Awesome fonts locally, not from remote.

First time to byte is abysmal: over 5 seconds (until ready for interaction: 9s).

pagespeed.PNG

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, dragan said:

Try to load JS+CSS without AIOM. It takes over 3 seconds to load... Also, load the Font Awesome fonts locally, not from remote.

First time to byte is abysmal: over 5 seconds (until ready for interaction: 9s).

pagespeed.PNG

Thanks, i will try now.

if used lazy load it's resolve the problem ?

and how can active gzip? i tried to activate it in vps and by use htaccess but faild.

and what's the website u used to analytics of speed?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Kiwi Chris
      More than a year after I submitted a proposal, I finally was given the contract to build a new website for a regional promotion organisation, promoting a very sparsely populated part of NZ.
      https://www.pelorus.nz/
      The original website I think was running CMS Made Simple, however it was not mobile friendly, and the organisation of directory listings into categories was unreliable, and edits required requests to the original developer.
      My brief was to make the site mobile friendly, and user editable, although I also ended up providing some of the photography as some of the site owners were slow to come forward with material themselves. I didn't rewrite content as that was beyond the scope of what I was asked to provide.
      Bootstrap 4 came out after I'd already started the project, so it's built using Bootstrap 3.
      Modules I used:
      Admin Restrict Branch (So owners of listings can log in and edit their own listings, but nothing more) AIOM+ - I found the LESS compilation handy, as I could work with the Bootstrap source files and adjust variables rather than overriding compiled bootstrap. Fieldtype Phone - so I could easily format phone numbers so that they would work both as URLs and display correctly. Social Share Buttons - although I created a modified colour set of icons. Jumplinks - to map URLs from old site to maintain SEO.  
    • By creativejay
      I'm displaying a list of products which are found by their templates, but the pages are taking a very long time to load. At first, I blamed it on my image rendering (using PIM2), but even with all those images now stored in the file tree, the page is taking abysmally long to load. ProCache seems to help but I don't feel as though what I'm trying to do should be gnawing the bones of my resources quite so long.
      The variable for the selector is defined in my header include:
      $productCatList="prod_series|prod_series_ethernet|prod_series_access|prod_series_accessories|prod_series_fiber|prod_series_pwr_supplies|prod_series_pwr_systems|prod_series_wireless"; $getCurrentProdOptions="template=$productCatList, prod_status_pages!=1554|1559|1560|4242"; Then in the template for the page upon which the directory loads:
      $products = $pages->find("$getCurrentProdOptions"); include_once("./prod-list-row.inc"); echo $out; And the prod-list-row.inc foreach (which is on every page that's exhibiting the slowdown):
      <?php $sum = 0; $out =""; $out .= "<div class='span_12_of_12'>\n"; foreach($products as $p){ $sum += 1; if ($sum % 2 == 0) { $bgcolor = '#fff'; } else { $bgcolor = '#e4e4e4';} $par = $p->parent; $out .="<div class='section group' style='background: $bgcolor ; min-height: 110px'>\n"; $img = $p->prod_image; $thumb = $img->pim2Load('squarethumb100')->canvas(100,100,array(0,0,0,0),'north',0)->pimSave()->url; $out .="<div data-match-height='{$p->title}' class='col span_2_of_12 hide'>"; $out .="<a href='{$p->url}'><span class='product-image-box'><img src='{$thumb}' alt='{$p->title}' title='{$p->title}'></span></a>"; $out .= "</div>"; $out .= "<div data-match-height='{$p->title}' class='col span_6_of_12'>"; $out .= "<div class='prod-list-name-label'><a href='{$p->url}'>{$p->title}</a></div>"; if($page!=$par) { $out .= "<div class='prod-list-category-label' style='font-size: .7em;'>Category: <a href='{$par->url}'>{$par->title}</a></div>"; } $out .= "<div class='list-headline' style='font-size: .8em;'>{$p->headline}</div>"; $out .="<div class='learn-more-buttons-sm'>"; $out .="<a href='{$p->url}' title='Product Specs and Documentation'><span class='find-out-more-button' style='font-size: .8em;'><i style='font-size: .8em;' class='fa fa-lightbulb-o' ></i> &nbsp; Learn More</span></a>"; $out .="</div>"; $out .="</div> \n"; $out .= " <div data-match-height='{$p->title}' class='col span_4_of_12'>"; if(count($p->prod_feat_imgs) >0 ){ $out .= "<div class='featured-icons-list' margin: 2em .5em;'>"; foreach($p->prod_feat_imgs as $feat){ $icon = $pages->get("$feat->prod_featicon_pages"); if($icon->image) { if($feat->prod_feat_textlang) { $icontitle = $feat->prod_feat_textlang;} else {$icontitle = $icon->title;} $out .= "<img src='".$icon->image->size(35,35,$imgOptions)->url . "' alt='" . $icontitle . "' title='" . $icontitle . "' class='listing-feat-icon' style='margin-right: .5em;' />"; } } $out .= "</div>"; if($p->prod_product_line){ foreach($p->prod_product_line as $pline) if($pline->image) { $out .= "<div style='height: 35px;'>\n"; $out .= "<img src='{$pline->image->size(75,35,$imgOptions)->url}' alt='{$pline->title}' />"; $out .= "</div>"; } } } $out .= "</div>"; $out .="</div>"; } $out .= "</div>";  
      Is there a clear culprit here of what I'm doing that's so stressing the system?
      I turned off TracyDebugger because I saw another thread about that causing slowdown (even though I'm using the latest), but that had no effect. Every time I thought I found the culprit and commented it out, nothing changed.
      Would appreciate some more eyes on this. Thank you!
      ETA: prod_feat_imgs is a repeater field which contains a Page reference field (from which I pull the image and title) and a multilanguage textfield (to override the page reference title if it exists). Could that be the problem?
    • By mrjasongorman
      I have a website with a slow page load mainly due to a slow query on a listing. I think there might be a better way to query the data / arrange the data back end which is what's causing the query to be slow.
       
      So the data is like this
      Area -> Level -> Path, the path then links to a pool of units included within that path.
      The units then have study locations listed as child pages for that unit with contact information etc.
      I have a page where i list all the study locations, but because i'm going through every unit and then every child study location page it takes quite a while.
      I have over 200 units with around 5 locations as sub pages.
      Any way i can reorganise the data to make this listing faster to load?
       
    • By pppws
      hey there,
       
      i have a collection (parent page) of persons (child pages of 'collection'). each person has several fields. two of them are repeater fields where the person can enter their 'jobs' and 'recidencies'. i'm trying to build a list of entries which looks like:
      Actor
      Peter Maria Paul … Doctor
      Eva Julia William … for the first 5 persons everything worked smoothly. but now that i've reached about 20 entries the server slows down and i'm wondering if my loop is somehow cluttred up.

       
      <?php $langname = $user->language->title; //get current user language?> <?php $persons = $pages->get('/collection')->children->filter("lang=$langname") // get all children for current user language ?> <section class="profession"> <h1>professions</h1> <?php foreach ($persons as $child): ?> <?php foreach ($child->professions as $profession): // the repeaterfield is called: professions, the field itself is profession?> <?php $profAll[] = $profession->profession // store all entries; $profUnique = array_unique($profAll) // only unique entries ; sort($profUnique) // sort the entries; ?> <?php endforeach; ?> <?php endforeach; ?> <ul style="column-count: 2;"> <?php foreach ($profUnique as $profLetter): // loop through all professions ?> <li style="font-size: 2rem; list-style-type: none;" class="letter"><?= $profLetter // output one profession e.g. Actor?></li> <?php foreach ($persons->find("professions.profession=$profLetter")->sort('givenname') as $person): // find all persons who have the profession Actor ?> <li><a class="ajax" href="<?= $person->url ?>"><?= $person->givenname // output the name of person who fits the profession ?></a></li> <?php endforeach; ?> <?php endforeach; ?> </ul> </section>  
      is there a way to make this request faster? (i'll have at least two of them on the same page)
       
    • By ROLAND_JUNO
      Thanks everyone who responded, Dragan helped me out and got me up and running.
       
      Thanks
      Cam