Hello @mainframed,
Welcome to the community!
Here is a very basic example of how you would do this on a single server backend using a Flask request. (I set this up in JS because of the callback structure)
This is the result:

from dash import Dash, Input, Output, dcc, html, clientside_callback
from datetime import datetime
from flask import request
app = Dash(__name__)
server = app.server
serverRestarted = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
@server.route('/serverRestart', methods=['POST'])
def serverRestart():
if request:
if request.json == serverRestarted:
return {'status': 'ok', 'message': False}
return {'status': 'ok', 'message': True}
app.layout = html.Div([
html.Div(serverRestarted, id='syncServer'),
dcc.Store(id='serverRestart', data=serverRestarted)
])
clientside_callback(
"""function (data) {
async function serverRestartTest (data) {
const restarted = await fetch('./serverRestart', {'method': 'POST',
headers: {'content-type': 'application/json'},
'body': JSON.stringify(data)}).then(response=>response.json())
.then(data=>{ return data; })
if (restarted.message) {
alert('you are running an outdated server, please refresh')
}
}
setInterval(serverRestartTest, 30000, data)
return window.dash_clientside.no_update
}""",
Output('serverRestart', 'id'), Input('serverRestart', 'data')
)
app.run()
Breakdown of the code, every 30 seconds we ping the server to see if out time matches the last server restart, if not, then it sends that the server was restarted. This then sends an alert to the page that they need to refresh the page.
You can use an dcc.Interval with a clientside callback too, this is just basic example, since we would still need to send a fetch request from the client in order to achieve the desired result.
In a multi backend setup, you should be storing your last real server reload in a db somewhere, and then query from the server to match the time in the client. Otherwise, you’d encounter issues if some of your backend servers get out of sync with restarting (especially in the case of a supervisor)
Hope this helps. 