Author Topic: Speeding up home page  (Read 545 times)

0 Members and 1 Guest are viewing this topic.

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 412
    • Penn Lake Weather
Speeding up home page
« on: May 12, 2019, 10:09:24 AM »
pennlake.us

I was wondering if there is anything I can do or at least look at, to help speed up opening my home page. At times it takes about 2 seconds, but then there are times when it might take up to 6 seconds. Once loaded, anything from the menu loads almost instantly, it it just the initial loading of the home page.

I have tried using some web sites to determine if there was anything I could "Easily understand and do" but most of the results are beyond me.

Any suggestions would be helpful.

Thanks,

yamiacaveman

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1967
    • My PWS at Leuven Belgium Europe
Re: Speeding up home page
« Reply #1 on: May 12, 2019, 10:41:28 AM »
pennlake.us
I was wondering if there is anything I can do or at least look at, to help speed up opening my home page. At times it takes about 2 seconds, but then there are times when it might take up to 6 seconds. Once loaded, anything from the menu loads almost instantly, it it just the initial loading of the home page.
I have tried using some web sites to determine if there was anything I could "Easily understand and do" but most of the results are beyond me.
Any suggestions would be helpful.
Thanks,
yamiacaveman
There is a lot of information which must be current for a visitor: NWS forecast, moon-info, UV forecast, NWS advisories
So if no-one visit your site  for some time the "to old" data needs to be refreshed.

You have 10 different NWS alerts (Curly scripts) so  there is a cron-job needed having so many.
If you are not using a cron-job for the nws-alerts, you should read the readme and use one.

If you are familiar and use a  cron-job, you could test with another cron-job every 5 minutes which should access your start-page http://www.pennlake.us/index.php
That way all forecasts, moon-info will always be "recent" when a human-visitor access your site.

Wim
« Last Edit: May 12, 2019, 10:44:03 AM by wvdkuil »

Offline AD7ZD

  • Member
  • *
  • Posts: 18
Re: Speeding up home page
« Reply #2 on: May 12, 2019, 11:25:44 AM »
Here are a few online tools that will give you some insight into where your website is bogging down and some suggested actions for you to take. Check out:
https://tools.pingdom.com/
https://gtmetrix.com/
https://developers.google.com/speed/pagespeed/insights/
Good Luck!


CWOP: AD7ZD

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 412
    • Penn Lake Weather
Re: Speeding up home page
« Reply #3 on: May 12, 2019, 12:53:44 PM »
Thanks for your responses AD7ZD and wvdkuil!

I know there is a lot of info that needs to be retrieved to make things come up current. I do have a cron job set up on the server for the nws forecasts.

An example, I used AD7ZD suggestion and used the GTMetrics web site. Most of my stuff did pretty good, but I seemed to fail miserably with "Images" and other things like "Add Expired Headers", 

Leverage Browser Caching
Serve Scale Images
Combine images using CSS Sprites
optimize images

After looking at the above - will correcting these things along with wvdkuil suggestion really speed up my web page or not so much.

Again thanks for any suggestions.

yamiacaveman

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 929
    • LexMAWeather
Re: Speeding up home page
« Reply #4 on: May 12, 2019, 02:49:58 PM »
if you haven't yet done so, do a view source call when your site hasn't been accessed in a while.

  view-source:http://pennlake.us/

Unrelated, but you have some weird text following your <body> tag and then a second <head> section (you only get one per customer.  :grin:).

Code: [Select]
</head>
<body>

<head>
<style type="text/css">
.style2 {
text-decoration: none;
}
.style3 {
color: #FFFFFF;
}
</style>
</head>

Anyway, look for segments like this:

Code: [Select]
<!-- curl fetching 'https://api.weather.gov/gridpoints/BGM/76,12/forecast' -->
<!-- HTTP stats:  RC=200 dest=184.27.36.18 port=443 (from sce=173.230.251.210)
      Times: dns=0.101 conn=0.156 pxfer=0.280 get=0.336 total=0.615 secs -->

which show you how much time is chewed up fetching content from other servers. As others have said, those are the most likely culprits when the cached data isn't fresh.

This is the alert fetch part of the forecast processing:

Code: [Select]
<!-- curl fetching 'https://api.weather.gov/alerts?active=1&point=41.1131,-75.7749' -->
<!-- HTTP stats:  RC=200 dest=184.27.36.18 port=443 (from sce=173.230.251.210)
      Times: dns=0.150 conn=0.205 pxfer=0.327 get=2.057 total=2.384 secs -->

So that's about 3 seconds total getting the forecast data.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 797
  • #conligwx
    • conligwx.org
Re: Speeding up home page
« Reply #5 on: May 13, 2019, 05:47:20 AM »
you might also want to update some files:

http://www.pennlake.us/check-fetch-times.php?show=versions

but your main issue is the webserver:

https://gtmetrix.com/reports/www.pennlake.us/88lbuyyH

You may also ant to update PHP to 7.3 which is faster and enable http/2 on your site.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) Daytime FARS WeatherLink Live AirLink PurpleAir PA-II-SD CumulusMX


Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 412
    • Penn Lake Weather
Re: Speeding up home page
« Reply #6 on: May 13, 2019, 07:57:52 AM »
Thanks every one for your help!!!!

I will definitely take at look at your suggestions and see what I can do and figure out.

yamiacaveman