[Geoserver-users] Integrated GWC and non-default styles

Hi all,

On the caching defaults web administration page there is an option to 'automatically cache non-default styles'. With this checked (as is the case by default) I would expect WMS requests which are routed through the integrated GWC to respect the STYLES parameter and cache and respond with imagery in the alternative style but it doesn't seem to work. The STYLES parameter is ignored and the image always comes back with the default style.

Is this a bug or am I missing some configuration? I'm running 2.3.5.

Regards,
Andrew

On Tue, Aug 27, 2013 at 8:50 AM, Andrew Miskelly <
amiskelly@anonymised.com> wrote:

Hi all,

On the caching defaults web administration page there is an option to
'automatically cache non-default styles'. With this checked (as is the
case by default) I would expect WMS requests which are routed through
the integrated GWC to respect the STYLES parameter and cache and respond
with imagery in the alternative style but it doesn't seem to work. The
STYLES parameter is ignored and the image always comes back with the
default style.

Is this a bug or am I missing some configuration? I'm running 2.3.5.

As far as I know, changing the default should only affect layers created
after the default was changed,
every layer has its own setting that is, at creation time, a copy of the
defaults
So, have you checked the layer configuration?

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Thanks for your reply Andrea.

I haven’t actually changed any of the settings - ‘automatically cache non-default styles’ is selected out-of-the-box - and under the individual layer’s ‘tile caching’ configuration ‘Create a separate cache for each STYLE’ is selected. But this is not what happens - I only get a cache, and imagery, for the default style.

To recreate:

  1. Enable direct integration with GWC.
  2. Set up an imagery layer with a default and at least one alternate style.
  3. Preview the layer with OpenLayers and show the control panel.
  4. Choose ‘Tiled’ under ‘Tiling’. (Important, else the images will bypass GWC)
  5. Flick between the styles available in the ‘Styles’ drop-down.

You only get imagery in the default style.

Regards,
Andrew

···

On 27/08/2013 17:35, Andrea Aime wrote:

On Tue, Aug 27, 2013 at 8:50 AM, Andrew Miskelly <amiskelly@anonymised.com> wrote:

Hi all,

On the caching defaults web administration page there is an option to
‘automatically cache non-default styles’. With this checked (as is the
case by default) I would expect WMS requests which are routed through
the integrated GWC to respect the STYLES parameter and cache and respond
with imagery in the alternative style but it doesn’t seem to work. The
STYLES parameter is ignored and the image always comes back with the
default style.

Is this a bug or am I missing some configuration? I’m running 2.3.5.

As far as I know, changing the default should only affect layers created after the default was changed,
every layer has its own setting that is, at creation time, a copy of the defaults
So, have you checked the layer configuration?

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Tue, Aug 27, 2013 at 9:57 AM, Andrew Miskelly <
amiskelly@anonymised.com> wrote:

Thanks for your reply Andrea.

I haven't actually changed any of the settings - 'automatically cache
non-default styles' is selected out-of-the-box - and under the individual
layer's 'tile caching' configuration 'Create a separate cache for each
STYLE' is selected. But this is not what happens - I only get a cache, and
imagery, for the default style.

To recreate:

1. Enable direct integration with GWC.
2. Set up an imagery layer with a default and at least one alternate style.
3. Preview the layer with OpenLayers and show the control panel.
4. Choose 'Tiled' under 'Tiling'. *(Important, else the images will
bypass GWC)*
5. Flick between the styles available in the 'Styles' drop-down.

You only get imagery in the default style.

Hmmm tricky. I guess in your case the preview happens to have an extent
that matches
the GWC Tiles (it's not designed to work like that out of the box).
Anyways, this could be a limitation in the direct integration, have you
tried out hitting
GWC directly instead, using the GWC own OL previews?

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Using GWC directly produces the same result.

So I guess the problem boils down to the fact that

/geoserver/gwc/service/wms?REQUEST=GetMap&LAYERS=my:layer&STYLES=

and

/geoserver/gwc/service/wms?REQUEST=GetMap&LAYERS=my:layer&STYLES=non_default

return the same thing (some parameters omitted for clarity). Changing the FORMAT parameter from image/png to image/jpeg to ensure a cache MISS still results in an image with the default style when STYLES=non_default is specified. The STYLES parameter is simply ignored.

Regards,
Andrew

···

On 27/08/2013 18:13, Andrea Aime wrote:

On Tue, Aug 27, 2013 at 9:57 AM, Andrew Miskelly <amiskelly@anonymised.com> wrote:

Thanks for your reply Andrea.

I haven’t actually changed any of the settings - ‘automatically cache non-default styles’ is selected out-of-the-box - and under the individual layer’s ‘tile caching’ configuration ‘Create a separate cache for each STYLE’ is selected. But this is not what happens - I only get a cache, and imagery, for the default style.

To recreate:

  1. Enable direct integration with GWC.
  2. Set up an imagery layer with a default and at least one alternate style.
  3. Preview the layer with OpenLayers and show the control panel.
  4. Choose ‘Tiled’ under ‘Tiling’. (Important, else the images will bypass GWC)
  5. Flick between the styles available in the ‘Styles’ drop-down.

You only get imagery in the default style.

Hmmm tricky. I guess in your case the preview happens to have an extent that matches
the GWC Tiles (it’s not designed to work like that out of the box).
Anyways, this could be a limitation in the direct integration, have you tried out hitting
GWC directly instead, using the GWC own OL previews?

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it