Lets say you need to refresh your tiles every X seconds to render live information, let's make use of Custom Protocos support.
Let's say your tiles are timestamped using epoc, and the endpoint reacts to URI params like this example
https://example.com/12/2005/1545.pbf?timestamp=1628597308254
Then you just
map.on('load', () => {
map.addLiveSource(
'test-livesource',
{
"sourcelayer": 'test-livelayer',
"tiles": ['live://example.com/{z}/{x}/{y}.pbf'],
"timeparam": 'timestamp'
"lifespan": 60000
...
}
);
map.addLayer({
"id": 'livelayer',
"source": 'test-livesource',
"source-layer": 'test-livelayer',
...
}
});
...
});
I have no live source to test agaist. I made it just for inspiration, so if you want to use it you will need to work on it... maybe a lot.