Loading data from CzmlDataSource returns a 404 even when the file exists


I have a czml file with some locations inside to be shown in a map. This loads some 3D models in those locations. Those models change periodically, so the function lo load them is called every 5 minutes.

I can correctly load the data and show it, and it works correctly for a time, but after some calls to the corresponding function, the data is missing, even if the file still exists in the server. This file is read once and over (every time the function is called) and there is a moment in which it cannot be found, but it still exists. I don't care if the file is not found, what I want is to show the models with the last read information if this happens. This is the code inside that function:

var czmlSource = new Cesium.CzmlDataSource();
czmlSource.process('./data/myfile.czml?'+ new Date().getTime());

I have read that using "process" instead of "load" the previous data remains, in order to be loaded the next time, but I have checked that what it does is to add the new read information to the old one. This does not work for me neither, because the location of the models could change, and with "process" I could have double locations.

What I want is to load the file, and if it fails, keep the previous information.

Thank you in advance for any help,

It does look like the call to process will create or modify entities from the pre-existing data based on the source code here.

I’m not sure exactly what you mean by the data is missing even though the file exists in the server. What data exactly is missing? Are you getting 404’s in your network tab or console?

One thing you could do is fetch the CZML file as a regular JSON, do your own set of validation yourself, and you decide you want to load it, only then do you call load or process. A CZML file is just a JSON file, and so you can fetch it in CesiumJS with: