raspberry pi - Reload page if 'not available'? -
i've standalone raspberry pi shows webpage server.
it reloads after 30 minutes via javascript on webpage.
in cases, server isn't reachable short time , chromium shows usual this webpage not available
message, , stops reloading (because no javascript page triggers reload).
in case, how can still reload webpage after few seconds?
now had idea fetch website results via ajax , replace in current page if available.
rather refreshing webpage every few minutes, can ping server using javascript (pingjs nice library can that)
now, if ping successful, reload page. if not successful, wait 30 more seconds , ping again. doing continuously, make wait until server open again (i.e. can ping it)
i think simpler method compared making own java browser , making browser plugin.
extra info: should use exponential function or timeout checking avoid unnecessary processing overhead. i.e. first time out find ping fails, wait 30 seconds, second time wait 30*(2^1) sec, 3rd time wait 30*(2^2) , on until reach maximum value.
note - assumes server unreachable ... , not html page in unavailable (there's small appreciable difference)
Comments
Post a Comment