Refreshing background for simple.php [Closed]

Is it working for you? I have to say I can see mine working here and Bashy’s working here but not yours here.

Can either of you see my background refresh working every 65 secs?

Yeah, I see yours change

Thanks! I was beginning to wonder if my method only works for the owner :wink:

I don’t know lol
I get different behaviour on different browsers on different machines
I have a feeling my issue reltes to caching going on either on the CDN proxy or the server somewhere, going to have to do some tests.
I actually view it in a kiosk’d old tablet that hard refreshes every 5 mins (on top of the normal data refresh) so for my own use at the moment it’s ok, but obviously there is something odd happening somewhere

This is actually quite odd
Chrome seems to be ignoring my headers and delivering from cache even when explicitly told not to.
If I disable cache in Chrome Dev Tools the page works as expected
What browser are you using?
It works as expected for me in Firefox

I can confirm it works in Firefox, but not in Chrome or Edge :?

Yea odd

This might need a delve into StackFlow

Works fine for me in chrome (main browser) fully kiosk, Edge and ff, I placed the refresh code on line 15 or 14 I think it was, when I put it lower down, it didn’t work…

Ps,i think it was added to simple.php not -_data.php

Just double checked it, I deffo added the refresh code to the below the last line of the settings section and I have no issues with it refreshing on any browser, after all, it is simple.php that your want to refresh

To check, you changed this:

$allow_lng_slct = true;         // set to false if not needed as in most cases
$allow_refresh  = true;        // set to false if text not wanted
$use_header     = true;         // set to false if no headline with stagtion name BUT no refresh counter visible in that case also
$reloadTime     = 30;           // time between loading new data from website
$max_width      = 1030;         // 3 blocks / row  set to comment if you want 4 blocks / row 
#$max_width      = 1360;        // 4 blocks / row ! remove # in first position if you want 4 blocks / row 
#
#-----------------------------------------------
#                                    colors used 
#-----------------------------------------------
#   => remove # on first position on line to use. 
#   => Set a # on first position of all other lines

To this:

$allow_lng_slct = true;         // set to false if not needed as in most cases
$allow_refresh  = true;        // set to false if text not wanted
$use_header     = true;         // set to false if no headline with stagtion name BUT no refresh counter visible in that case also
$reloadTime     = 30;           // time between loading new data from website
$max_width      = 1030;         // 3 blocks / row  set to comment if you want 4 blocks / row 
#$max_width      = 1360;        // 4 blocks / row ! remove # in first position if you want 4 blocks / row 
#
header("Refresh:65"); 
#-----------------------------------------------
#                                    colors used 
#-----------------------------------------------
#   => remove # on first position on line to use. 
#   => Set a # on first position of all other lines

?

Yep…

If you add the line to simple.php you should comment it out in _data.php

Great thanks, have made the change, now to watch

Yes have done this also, thanks

Unfortunately the same result

Works in Firefox but nothing else

Real head scratcher

Makes no sense, I have it working in all browsers :confused:

Yea for some reason it just doesnt like the headers and ignores them, always getting the image from cache.

I dont know where it is getting the

cache-control: max-age=2592000

from when it ignores the “no cache” header it is being sent

It does seem to be reloading, but not the image

Confirmed. But there is something funny about your data refresh, too. I have noticed that your windspeed and direction are sometimes unchanged for more than one data refresh period, which is unlikely, and the green data change flash doesn’t always work. . . :?

Agreed

But I have no idea why with that either!

There is some caching going on but I can’t pinpoint where

I think it’s worth noting that the image works and updates fine on the regular dash, in Chrome etc…

I believe that is the case because Wim versions the file eg https://pws.lowersheering.com/livefeed.jpg?_1644408079

Meaning the browser is forced to grab a fresh copy each time

I can only assume that because the URL is the same Chrome is not picking it up again (why it does for you guys I have no idea at all)

I also assume that is why my Data doesn’t update correctly on Simple.php as well

And just to confuse things even more, sometimes the background image disappears altogether in Firefox :? :?

I think I’ve seen posts about that, but I’ve never taken any notice because my very old version has nothing like that. A third-part app uploads an image from my camera every 60 secs. The image is always called out1.jpg, so it overwrites the last one and the PWS dashboard and Simple seem to have no trouble using what is there.

LATER EDIT: I have just realised that my very old version of the dashboard does add a timestamp, as described, in webcam_c_block.php and webcam_popup.php :oops: