Author Topic: Saratoga template site loads very slowly  (Read 915 times)

0 Members and 1 Guest are viewing this topic.

Offline lobsterman

  • Senior Contributor
  • ****
  • Posts: 164
    • Cape Small Harbor Weather
Saratoga template site loads very slowly
« on: October 28, 2018, 04:49:50 PM »
Can anyone give some pointers about what might be causing this site http://suiattle.net/CapeSmallHarborWeather/mbridge/index.php to load so slowly? I'm sure I have made some kind of basic config error but cannot seem to locate it.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga template site loads very slowly
« Reply #1 on: October 28, 2018, 05:48:53 PM »
It may be that your site is timing out waiting for the USNO to respond
Quote
<!-- loading ./cache/USNO-moondata.txt from http://api.usno.navy.mil/rstt/oneday?date=10/28/2018&coords=43.733,-69.842&tz=-4 -->
<!-- curl fetching 'http://api.usno.navy.mil/rstt/oneday?date=10/28/2018&coords=43.733,-69.842&tz=-4' -->
<!-- curl Error: connect() timed out! -->

Try adding to your Settings.php
Code: [Select]
$SITE['useUSNO'] = false; //=false for internal calcs, =true to use USNO for sun/moon to use the internal calculations for sun/moon times instead of the USNO.
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 lobsterman

  • Senior Contributor
  • ****
  • Posts: 164
    • Cape Small Harbor Weather
Re: Saratoga template site loads very slowly
« Reply #2 on: November 03, 2018, 06:34:49 PM »
That does seem to have taken care of the problem. Load time now about 2 seconds, which I suppose is "normal"? Any other tips for improving load times?

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Saratoga template site loads very slowly
« Reply #3 on: November 03, 2018, 07:38:55 PM »
It depends on how adept you are at PHP coding and how flexible your hosting site is at running cron jobs. I've set myself up so that a load of my home page doesn't require the server to do any external fetches - everything is pre-cached by cron jobs and loaded directly from the server cache files. Alerts, forecast, USNO, METAR, images, etc...

Also, my home page is divided into "accordion" sections, most of which are closed. For the sections that are closed which include images (radar, satellite), I don't load the image until and unless the user clicks the section to open up.

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

Offline lobsterman

  • Senior Contributor
  • ****
  • Posts: 164
    • Cape Small Harbor Weather
Re: Saratoga template site loads very slowly
« Reply #4 on: November 03, 2018, 08:02:03 PM »
Good point, and your site is a good example!