[Geoserver-devel] [jira] Created: (GEOS-4172) Cache-control headers are not set on WMS responses

Cache-control headers are not set on WMS responses
--------------------------------------------------

                 Key: GEOS-4172
                 URL: http://jira.codehaus.org/browse/GEOS-4172
             Project: GeoServer
          Issue Type: Bug
          Components: WMS
    Affects Versions: 2.1-beta1
            Reporter: Arne Kepp
            Assignee: Gabriel Roldán
             Fix For: 2.1-beta2

This is essentially the same thing as GEOS-4170 , assigning to you Gabriel because of the recent refactor and since you're the author listed in the file. But I can handle the fix if you agree with the chage:

In GetMap.java ,

WebMap run(final GetMapRequest request, WMSMapContext mapContext)

there is a huge loop that loops over the layers in the request, and picks an else-if section based on the type.

Basically what the Cache-control header needs is the following in each section for the layer type:

if(layer.isCachingEnabled()) {
  cachingPossible = cachingPossible && layer.isCachingEnabled();
  if(cachingPossible && layer.getCacheMaxAge() < maxAge) {
    maxAge = layer.getCacheMaxAge();
  }
} else {
  cachingPossible = false;
}

The trouble is that certain layer types get special treatment. So instead of repeating this in every type section in the loop, I think we should update the isCachingEnabled() and getCacheMaxAge() methods on the layer objects smarter, so that we only need this code on the top of the loop, and not repeated for every type.

Does this make sense?

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira