Refresh Timer for template
- Dehatter
- Professional

- Posts: 350
- Joined: Sun Jan 07, 2018 5:11 am
- Location: Matthews, NC, USA
- Station model: Ecowitt WH80
- Software: Ecowitt GW1000
- Contact:
Refresh Timer for template
I noticed that if I left the webpage open for an extended period of time, most of the blocks become stale. I added a timer so my page refreshes automatically every 30 mins (adjustable time). It is really easy to do, but would like some feedback before I share it.
Thanks!
Tom
Thanks!
Tom
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Refresh Timer for template
Which blocks freeze? Most blocks are static, the few interactive ones (current etc.) should keep updating indefinitely
- Johnny
- Developer

- Posts: 313
- Joined: Sat Aug 19, 2017 10:16 pm
- Location: Watford, Hertfordshire, England
- Station model: Davis Vantage Pro2 Plus
- Software: Meteobridge
- Contact:
Re: Refresh Timer for template
For me the block that doesn't update is 'stationData' I have to refresh the browser or select a new period from the stationData drop-down menu. I've always assumed that's the way this block is meant to work.
http://www.watfordweather.uk
http://www.watfordweather.co.uk
http://www.watfordweather.uk
http://www.watfordweather.co.uk
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Refresh Timer for template
No, not all blocks update, that would consume way too much resources
Blocks which update include current, gauges, steel series, some image blocks, webcam etc.
Blocks which update include current, gauges, steel series, some image blocks, webcam etc.
- Dehatter
- Professional

- Posts: 350
- Joined: Sun Jan 07, 2018 5:11 am
- Location: Matthews, NC, USA
- Station model: Ecowitt WH80
- Software: Ecowitt GW1000
- Contact:
Re: Refresh Timer for template
The following blocks do not update on a schedule that can can see:
Forecast
Meteogram
Air Quality
Station Status
Warnings
Station Records
Wind
World Weather
Earthquakes
Today
So rather than mess with putting a timer in all of them, I just refresh the page twice an hour. It is a single line of code.
Forecast
Meteogram
Air Quality
Station Status
Warnings
Station Records
Wind
World Weather
Earthquakes
Today
So rather than mess with putting a timer in all of them, I just refresh the page twice an hour. It is a single line of code.
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Refresh Timer for template
No those dont, I did not expect someone would be looking at the page for like an hour or so. Placig a timer would slow down the entire website a lot if every user triggered dozens of updates every few seconds
- Dehatter
- Professional

- Posts: 350
- Joined: Sun Jan 07, 2018 5:11 am
- Location: Matthews, NC, USA
- Station model: Ecowitt WH80
- Software: Ecowitt GW1000
- Contact:
Re: Refresh Timer for template
Well i don't stare at it for an hour, but I have left the page open...lol.
I agree most of them do not need updating every few seconds. A few updating would be helpful.
Trends Today Warnings wind stationstatus and stationaverages on the half hour
forecast meteogram stationrecords airquality much less frequently
windy times out after some period and goes away.
and at least once a day for the rest of them
I agree most of them do not need updating every few seconds. A few updating would be helpful.
Trends Today Warnings wind stationstatus and stationaverages on the half hour
forecast meteogram stationrecords airquality much less frequently
windy times out after some period and goes away.
and at least once a day for the rest of them
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Refresh Timer for template
Hi,
this in my opinion is not very useful - once per day? That would assume you really keep looking at it for a day, the page being opened for a day or more. Every block auto-updates during each loding, so I really dont think many people spend more than a few seconds or max. minutes on the homepage before they go somewhere else on the website or elsewhere
this in my opinion is not very useful - once per day? That would assume you really keep looking at it for a day, the page being opened for a day or more. Every block auto-updates during each loding, so I really dont think many people spend more than a few seconds or max. minutes on the homepage before they go somewhere else on the website or elsewhere
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Refresh Timer for template
Every JS timer potentially slows the page down and considering the Pros and Cons Im not a big fan of this, those that really need updating - eg. the current and gauges, already have it
-
Lespius
- Advisor

- Posts: 61
- Joined: Wed Aug 23, 2017 7:32 pm
- Location: Cugy, Switzerland
- Station model: Davis VP2
- Software: Meteobridge
- Contact:
Re: Refresh Timer for template
Hi,
I input a line of code for an autorefresh as well, every 5 minutes. Mainly to refresh the interactive graph block.
I input a line of code for an autorefresh as well, every 5 minutes. Mainly to refresh the interactive graph block.
- Jachym
- Site Admin

- Posts: 1686
- Joined: Fri Aug 18, 2017 10:12 pm
- Location: Brno, Czech Republic
- Station model: WH1080
- Software: Meteobridge
- Contact:
Re: Refresh Timer for template
Yes, that will work of course and feel free to do so. It is not so elegant solution because the entire page has to reload, but it will do the trick. Probabyl easiest solution.