Author Topic: slow website..  (Read 1604 times)

0 Members and 1 Guest are viewing this topic.

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1057
    • GosportWx.com
slow website..
« on: January 27, 2024, 04:26:26 PM »
I've tested this and it seems that ajax-dashboard.php makes my index.php page load very slow any ideas why????

Mike
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9722
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: slow website..
« Reply #1 on: January 27, 2024, 05:03:50 PM »
So one issue is the nws-alerts.
Code: [Select]
<!-- nws-alerts.php - V1.44 - 24-Mar-2023 -->
<!-- 14 unique Zone entries found. Zones='INZ052,INC021,INZ061,INC055,INZ070,INC093,INZ062,INC105,INZ036,INC109,INZ053,INC119,INZ045,INC133' -->
<!-- Cron job enabled -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=INZ052&y=1 -->
<!-- HTTP stats:  RC=200 dest=23.221.240.16 port=443 (from sce=10.0.2.143)
      Times: dns=0.002 conn=0.033 pxfer=0.387 get=0.051 total=0.439 secs -->
...
<!-- Cache file updated: Sat 01-27-2024 4:53 pm -->
<!-- Alert box data file updated -->
<!-- Icon data file updated -->
<!-- Alert logging enabled -->
<!-- Total process time: 6.7966 seconds -->
and that's 7 extra seconds for page load.  Has your cron job for nws-alerts.php stopped working?  With 14 zones, you definitely need a cron job to offload that time to the webserver so the viewer of the page doesn't have to wait.
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 mkutche

  • Forecaster
  • *****
  • Posts: 1057
    • GosportWx.com
Re: slow website..
« Reply #2 on: January 27, 2024, 05:05:12 PM »
So one issue is the nws-alerts.
Code: [Select]
<!-- nws-alerts.php - V1.44 - 24-Mar-2023 -->
<!-- 14 unique Zone entries found. Zones='INZ052,INC021,INZ061,INC055,INZ070,INC093,INZ062,INC105,INZ036,INC109,INZ053,INC119,INZ045,INC133' -->
<!-- Cron job enabled -->
<!-- XML source: https://alerts.weather.gov/cap/wwaatmget.php?x=INZ052&y=1 -->
<!-- HTTP stats:  RC=200 dest=23.221.240.16 port=443 (from sce=10.0.2.143)
      Times: dns=0.002 conn=0.033 pxfer=0.387 get=0.051 total=0.439 secs -->
...
<!-- Cache file updated: Sat 01-27-2024 4:53 pm -->
<!-- Alert box data file updated -->
<!-- Icon data file updated -->
<!-- Alert logging enabled -->
<!-- Total process time: 6.7966 seconds -->
and that's 7 extra seconds for page load.  Has your cron job for nws-alerts.php stopped working?  With 14 zones, you definitely need a cron job to offload that time to the webserver so the viewer of the page doesn't have to wait.

switched servers so idk as i do not have access to cron job i'll take off the zones and just have 1 ... where would that be bc i only see 7 zones ??
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1057
    • GosportWx.com
Re: slow website..
« Reply #3 on: January 27, 2024, 05:10:51 PM »
yay looks like that fixed it thanks ken :)
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1057
    • GosportWx.com
Re: slow website..
« Reply #4 on: January 27, 2024, 05:17:51 PM »
another quick question will the website scripts and what not accept redis caching?
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9722
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: slow website..
« Reply #5 on: January 27, 2024, 06:48:33 PM »
I don't recommend caching be enabled for personal weather websites .. with AJAX updating conditions/images, caching by the webserver just means some parts of your site will be stale/out-of-date.
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