Cache Http error 404 for map tiles coming from AWS CloudFront

Viewed 93

I serve images tiled to Openlayers through AWS CloudFront.

There are many tiles that Openlayers asks that don't exist in the tiles storage on S3. (It is probably because of the defined extent in the tile Layer I guess).

Openlayers keeps requesting again and again those missing tiles when I pan the map. Having many images tiled on the map, it makes everything slow.

How can I make sure that the browser stop requesting those missing tiles? My guess was to make CloudFront serve a 410 http error (gone) instead of the 404. But it seems that we can't change to 410. See this print screen below. Any other ideas are welcome. Thanks!

enter image description here

0 Answers
Related