image caching

I'm displaying multiple images using CZML:

"polygon": {
   "height": polygonHeight,
   "positions":
   {
       "cartographicDegrees": pos
   },
   "material": {
     "image": {
         "image": { "uri": imageUri},
         "color": {
             "rgba": [255, 255, 255, 255]
         }
     }
   }
}

Whenever image is added to the list or removed, the whole CZML object is recreated.
The images are static images.

For performance reasons I would expect Cesium to use browser cache and not download images each time.
Unfortunately this not the case - the request for the images has the following headers set:
Cache-Control:no-cache
Pragma:no-cache

Is it possible to make Cesium to use the cache?

Thank you

Cesium does not disable the cache when requesting images.

Are you using the Chrome developer tools? Do you have “Disable cache” checked? I believe when checked, that will add the headers you are seeing to every request.

Hello,

I’m a little confused about what you’re asking. How are you adding and removing the images?

I think Cesium does use caching for image materials, but I’m not sure.

Best,

Hannah

Scott,

You're right - I had disable cache checked

My bad :slight_smile: