[Geoserver-devel] GWC caching empty KML tiles

Hi,
I'm looking a bit into the GWC integration with GeoServer
and it seems that the trick we used to avoid caching empty
tiles is not working anymore.

The trick was to return a HTTP 204 when GS generated an
empty tile, and that resulted in GWC skipping that tile and
the whole subtree under it.

However, as far as I can see that has been not working anymore
since a long time, basically, since the time we switched
off superoverlay as the default mode.

As far as I can see the only code that returns a 204 is
in the superoverlay encoders, but those are not run anymore
by default.

I guess we should do the same and return a 204 also in
"download" mode when we see the tile is empty?
At least, the request that I see GWC making is a plain
GetMap in KML format, which should behave in "download"
mode, no?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

"superoverlay mode" = regionated KML

I don't think this kind of caching makes sense for any mode other than regionated data ?

GWC will find the tile (or tiles if it is world wide) that fit the bounding box, so if I understand GeoServer's behavior correctly, all the features will be put into a single tile. GWC was not designed to stream large files as tiles, it would have to work more like the WFS stub and stream from disk.

I would just change GWC so that it passes mode=superoverlay whenever kml.km[z|l] is requested ? Let me know and I'll put it into 1.2.2 which I am polishing right now.

(I thought I had already done that, but admittedly I haven't worked on this for ages, and the switch happened at a time I was pretty busy with other stuff.)

-Arne

Andrea Aime wrote:

Hi,
I'm looking a bit into the GWC integration with GeoServer
and it seems that the trick we used to avoid caching empty
tiles is not working anymore.

The trick was to return a HTTP 204 when GS generated an
empty tile, and that resulted in GWC skipping that tile and
the whole subtree under it.

However, as far as I can see that has been not working anymore
since a long time, basically, since the time we switched
off superoverlay as the default mode.

As far as I can see the only code that returns a 204 is
in the superoverlay encoders, but those are not run anymore
by default.

I guess we should do the same and return a 204 also in
"download" mode when we see the tile is empty?
At least, the request that I see GWC making is a plain
GetMap in KML format, which should behave in "download"
mode, no?

Cheers
Andrea

Arne Kepp ha scritto:

"superoverlay mode" = regionated KML

I don't think this kind of caching makes sense for any mode other than regionated data ?

Correct, I realized it while I was having breakfast this morning :slight_smile:

GWC will find the tile (or tiles if it is world wide) that fit the bounding box, so if I understand GeoServer's behavior correctly, all the features will be put into a single tile. GWC was not designed to stream large files as tiles, it would have to work more like the WFS stub and stream from disk.

I would just change GWC so that it passes mode=superoverlay whenever kml.km[z|l] is requested ? Let me know and I'll put it into 1.2.2 which I am polishing right now.

Yes, that is indeed necessary, you have to make GWC force superoverlay
mode and also the right subtype of it, which should be "auto" I think:
http://docs.geoserver.org/2.0.x/en/user/googleearth/features/kmlreflector.html#ge-feature-kml-reflector

So I think the extra params in the request should be:

&format_options=mode:superoverlay;overlaymode:auto

(at least that's what I gathered by looking into the reflector code,
  if you can double check)

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.