1

Are browsers supposed to cache blank tiles? I have a layer cached with GeoWebCache. When I request this layer via OpenLayers I can see that tiles containing data are taken from cache, the blank tiles are always requested from GeoServer (and then taken from cache?). Here is the screen - all requests on first screen returned empty tiles, still it takes lot of ms:

enter image description here

Here are the tiles containing actual data:

enter image description here

Is it standard behaviour of OpenLayers or I did something wrong? (I am using OpenLayers 2.13.1).


I can't find any header that may be responsible for caching by browser. Is it possible that OpenLayers is doing the caching based on the response?

Empty tiles response:

enter image description here

Tile with data response (cached)

enter image description here

So now I have 3 new questions:

  1. What is the reason? Is it because GeoWebCache is not caching empty tiles? Or OpenLayers is not letting browser to cache them?

  2. Is it more optimal not to cache empty tiles?

  3. How to change this behaviour?

closed as too broad by PolyGeo Aug 22 '16 at 20:41

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • If the server sends headers saying given resource should not be cached then a well-behaved browser won't cache. This has nothing to do with OpenLayers, one of your back-end components is apparently configured to disallow browser caching. You can verify that by comparing the "first-hit" responses' headers for blank and non-blank tiles. – kryger Jan 18 '16 at 0:37
  • As per the Tour there should be only one question asked per question. – PolyGeo Aug 22 '16 at 20:42