Page 1 of 1

Now & Today Pages Not Updating

Posted: Tue 23 Mar 2021 10:16 pm
by euphbass
Hi there,

I've set up the standard web template (as supplied with MX) on my webspace, and it's all working fine except that the front page (index.htm) and Today (today.htm) pages refuse to update unless I clear my browser history. The guages update fine, every 15 sec, and the graphs and so on are all fine. Cumulus itself is set to update as appropriate in the Internet settings.

The fact that I'm having to clear the browser history to get it to update suggests it's using a cached version, so I've tried using a Cache-Control modification in a .htacess file on the web server, and I've also tried using HTML meta tags on the affected pages:

<meta http-equiv=“Pragma” content=”no-cache”>
<meta http-equiv=“Expires” content=”-1″>
<meta http-equiv=“CACHE-CONTROL” content=”NO-CACHE”>

Neither has worked, unfortunately, so perhaps there's something more going on than just a cache issue? Also, if it was a cache issue, I'm sure more people would have had issues before now and I can't find this specific issue in the forum.

Also, it looks like it should be doing a forced update every 60 sec, according to the setpagedata.js file:

// auto update every 60 seconds, only the index and today pages
let pageName = window.location.href.split('/').pop();
if (pageName == 'index.htm' || pageName == 'today.htm') {
setTimeout(function () {
getPageData();
}, 60 * 1000);

But this isn't happening. Maybe it's refreshing from cache, I don't know.

Any suggestions for what's going on? Thanks!

Re: Now & Today Pages Not Updating

Posted: Tue 23 Mar 2021 10:45 pm
by beteljuice
There have been some 'fixes' ...

... try viewtopic.php?p=152628#p152628

Re: Now & Today Pages Not Updating

Posted: Tue 23 Mar 2021 11:15 pm
by ConligWX
there is a fix issued,

HOWEVER , what people also need to understand is the pages index.htm and today.htm are refreshed by default 60 seconds, but the data that these pages access is only updated by whatever CumulusMX Log interval is set as.

so, in my scenario, My CumulusMX Log interval is 5 minutes. So I only get a websitedata.json created every 5 minutes for the my website to read, no matter that the setpagedata.js defaults to "refresh the page" in 60 seconds.

Re: Now & Today Pages Not Updating

Posted: Wed 24 Mar 2021 9:45 pm
by euphbass
Thanks for the prompt replies! I've uploaded the latest setpagedata.js from the linked thread, and I've also changed the update rate in Cumulus to 2min rather than 30min (for easier testing, for the time being), and unfortunately it hasn't made any difference. Home and today still refuse to update without clearing the browser history. The website data.json file is updating on the server at the specified interval, it's just the webpage that won't update. Since the hacks to force it not to use cache haven't worked either, I'm pretty much out of ideas. Any suggestions most welcome!

Re: Now & Today Pages Not Updating

Posted: Wed 24 Mar 2021 9:49 pm
by freddie
It sounds as if your host has an aggressive caching policy. You might ask them to adjust the length of time JSON files are cached for. If you're self hosting you can make this adjustment yourself.

Re: Now & Today Pages Not Updating

Posted: Wed 24 Mar 2021 10:09 pm
by euphbass
Yes, it sounds like that might be the issue. I'm with Dreamhost. I've been looking into it and I've found their default caching times for various file types, and I'm modifying it via a .htaccess file. I've got it so it now updates with a standard page refresh, without having to clear the browser history - step in the right direction! Just need to keep at it and see if I can get it to auto-update somehow. Thanks for the advice!