Author Topic: Menubar script loading slowly since server swap  (Read 1107 times)

0 Members and 1 Guest are viewing this topic.

Offline R1ch1ew

  • Member
  • *
  • Posts: 19
    • Upper Caldecote Weather
Menubar script loading slowly since server swap
« on: December 22, 2018, 11:55:24 AM »
Hi, recently my host moved my weather site to a new server.  I've fixed most of the broken links, unfortunately I cannot solve a very slow loading problem.  I've got as far as identifying the menu bar script as being the problem, I'm a little stuck after that.  Also the UK weather extremes gadget on the menu bar has stopped working, the cache is updating but no data is loading into the cache even after changing the CHMOD to 666.  I'm wondering if the two issues are related.

www.upper-caldecote-weather.co.uk

Any pointers would be appreciated. 


Thanks in advance,

Richard

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: Menubar script loading slowly since server swap
« Reply #1 on: December 22, 2018, 02:11:22 PM »
To start with, you have a lot of files that require updating. I'd take care of that before chasing this too far:

   http://www.upper-caldecote-weather.co.uk/check-fetch-times.php?show=versions

https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Menubar script loading slowly since server swap
« Reply #2 on: December 22, 2018, 03:52:49 PM »
After updating the out-of-date scripts (especially get-USNO-sunmoon.php to V3.02) add to Settings.php
Code: [Select]
$SITE['useUSNO'] = false;
The api.usno.navy.mil site is having bad issues.. putting in that setting will cause the moonrise/moonset times to be calculated internally rather than fetching the data from the (malfunctioning) USNO site.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline R1ch1ew

  • Member
  • *
  • Posts: 19
    • Upper Caldecote Weather
Re: Menubar script loading slowly since server swap
« Reply #3 on: December 28, 2018, 12:31:11 PM »
HI, thank you for your prompt replies. 

I've updated the out of date files and amended the settings as suggested - what a great utility, thank for the heads up!

Unfortunately the updated files have not resolved my original problem.  I still have an extremely slow loading page which I feel sure is related to the UK Extremes gadget in my menu bar.  The slow loading only occurred when my host swapped me on to another server, since then the cache file has not had an data written to it and the High, Low and Precipitation have all shown 0.


Any pointers would be greatly appreciated.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Menubar script loading slowly since server swap
« Reply #4 on: December 28, 2018, 12:40:11 PM »
I'd done a USA Extremes script, but I'm not familiar with a UK Extremes script.. would you mind posting it so I can have a look. D'Oh.. It is one of the legacy scripts from Relayweather that I am distributing.  I'll take a look.

You're correct, the page slow loading is likely due to problems with one of the included() scripts in their access to external websites.
« Last Edit: December 28, 2018, 12:43:23 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Menubar script loading slowly since server swap
« Reply #5 on: December 28, 2018, 12:48:51 PM »
Meanwhile, I'd comment out the include for the extremes script and see if that improves your site load time.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Menubar script loading slowly since server swap
« Reply #6 on: December 28, 2018, 12:59:25 PM »
I tried the unmodified script (except to use United+K as the geography) and it completed normally (and quickly).

I think there's likely a routing issue between your website server and ogimet.net server (source of the data) and that is causing the excessive delay.  The script doesn't need a mod to work, only a good connection between your server and ogimet.net.

For now, commenting out the include() in your website would be the wise course.   Later, you can run worldextremesGadget.php in your browser to see if it's 'healed', then reenable the include after the connectivity issue is resolved.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline R1ch1ew

  • Member
  • *
  • Posts: 19
    • Upper Caldecote Weather
Re: Menubar script loading slowly since server swap
« Reply #7 on: December 28, 2018, 01:37:06 PM »
Hi, thanks again for taking a look at this.  I'll knock the gadget out and hopefully that'll improve the speed of my page loading - still strange that I cannot get any data to push into the cache.

Best wishes, Richard.

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: Menubar script loading slowly since server swap
« Reply #8 on: December 28, 2018, 02:05:11 PM »
Hi Richard

you may wanna take a look here:

I ran a report from gtmetrix (uk/chrome) to see what could be up.

https://gtmetrix.com/reports/www.upper-caldecote-weather.co.uk/Nkp2TdqU
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Menubar script loading slowly since server swap
« Reply #9 on: December 28, 2018, 02:26:28 PM »
Hi, thanks again for taking a look at this.  I'll knock the gadget out and hopefully that'll improve the speed of my page loading - still strange that I cannot get any data to push into the cache.

Best wishes, Richard.
That will happen if your webserver is unable to successfully access ogimet.net website.  Do take out the gadget for now.

Hi Richard

you may wanna take a look here:

I ran a report from gtmetrix (uk/chrome) to see what could be up.

https://gtmetrix.com/reports/www.upper-caldecote-weather.co.uk/Nkp2TdqU
Hi Simon,
That would let you know what separate parts (page load, scripts, images) were causing issues.  If the problem is within a single .php page that includes() other components, it will only show the overall page load time, and not the individual times of the included php pages (which is likely where the problem lies).  It is a good site to help you prune back images/JavaScripts so your overall page loads faster.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: Menubar script loading slowly since server swap
« Reply #10 on: December 28, 2018, 02:32:33 PM »
Thanks for the info Ken!

Sent from my ONEPLUS A6003 using Tapatalk

Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline R1ch1ew

  • Member
  • *
  • Posts: 19
    • Upper Caldecote Weather
Re: Menubar script loading slowly since server swap
« Reply #11 on: December 28, 2018, 05:01:39 PM »
Menubar file modified, site load is now instant!  When I go to the wxextreme page is all slows down again....

Thanks for your help!  Hopefully in time I can sort the UK extremes gadget out, not essential though.


Offline R1ch1ew

  • Member
  • *
  • Posts: 19
    • Upper Caldecote Weather
Re: Menubar script loading slowly since server swap
« Reply #12 on: January 20, 2019, 03:51:57 PM »
Hi, I realise I'm replying to a message closed down a couple of weeks ago.... But, I've got a strange thing going on with my site (www.upper-caldecote-weather.co.uk).

When I completed all my updates all appeared to be working fine, files uploading, pages displaying and a refresh every 7 seconds or so it appeared.  I've checked my site on another PC (different network) and when the pages initially loads all is OK, but the time is wrong and I'm not getting a refresh. 

Totally confused as to why it would work on one PC and not another.  I've cleared caches, tried different browsers but any PC other than the one that uploaded the files back in early Jan will not show the correct time and refresh.

I've checked the settings in the files I uploaded, I'm guessing there's a time zone issue but I cannot find it set incorrectly anywhere.  Any help would be gratefully received.

Thanks again.

Richard

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Menubar script loading slowly since server swap
« Reply #13 on: January 20, 2019, 05:14:07 PM »
I think the issue is in your WD setup itself.  Your testtags.php is showing
Code: [Select]
$time =  '22:06 PM'; // current time
$date =  '20/01/19'; // current date
22:06 PM means you have BOTH 24 hr time AND AM/PM selected in the WD, Control Panel, Units/Other Settings, Precision/Time/Date/Cloud Height TAB
Untick 'AM/PM', keep '24 Hour' ticked.

By rights, that should be a radio checkbox so one or the other can be selected :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline R1ch1ew

  • Member
  • *
  • Posts: 19
    • Upper Caldecote Weather
Re: Menubar script loading slowly since server swap
« Reply #14 on: January 21, 2019, 05:19:33 AM »
Hi, thank you for your help, I've corrected that setting, the time is OK but I cannot get the auto update to work.
This is so strange as I've made no setting changes, I wonder if a crash on the server damaged the WD settings? 

Regards,

Richard

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Menubar script loading slowly since server swap
« Reply #15 on: January 21, 2019, 10:16:10 AM »
Since Weather-Display is uploading to the ./WD/ directory, you should change your ajaxWDwx.js script from
Code: [Select]
var clientrawFile = 'clientraw.txt'; // location of clientraw.txt relative to this page on website
to
Code: [Select]
var clientrawFile = './WD/clientraw.txt'; // location of clientraw.txt relative to this page on website
so the script can find the updated clientraw.txt

Your wxstatus.php page does show that WD is updating your site correctly.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline R1ch1ew

  • Member
  • *
  • Posts: 19
    • Upper Caldecote Weather
Re: Menubar script loading slowly since server swap
« Reply #16 on: January 21, 2019, 01:50:11 PM »
Thank you again for your swift reply, I believe it's now all working like it did for many years...

It's my fault, my provider moved my site to a new location and some of the defaults changed.

Time to tidy the site up and save for a new weather station, my Oregon is almost 10 years old and starting to chew through batteries.

Best wishes and thanks again,

Richard