[Geoserver-devel] [jira] Created: (GEOS-420) Allow remote SLD xml to be fetched with a gzipped stream

Allow remote SLD xml to be fetched with a gzipped stream
--------------------------------------------------------

         Key: GEOS-420
         URL: http://jira.codehaus.org/browse/GEOS-420
     Project: GeoServer
        Type: Improvement
  Components: WMS
    Versions: 1.3-rc3
Environment: All
Reporter: Magne Skjeret
Assigned to: Gabriel Roldán
Attachments: GetMapKvpReader.java

When streaming a SLD file from a remote server using http, the transfer time can be greatly reduced if it allows for gzipped content.
The SLD is even streamed twice. Once of the validating part, and the other for the SLD parser code in geotools.

It is in a browser/web-server environment up to the browser/user-agent to request the content stream to be gzipped.
The user-agent sends the request parameter "Accept-Encoding: gzip, deflate" to the remote web-server. The webserver can then, if it supports it, return the byte stream gzipped greatly reducing the amount of bytes that needs to be transfered.

If the server can do gzip, the reponse is marked with Content-Encoding: gzip

An good example would be the response from www.google.com

My firefox browser sends this:
Accept-Encoding: gzip,deflate

Goolge responds like this:
Content-Encoding: gzip

I have altered the class GetMapKvpReader and added a getInputStream(URL sldUrl) method.
This method sends the gzip request parameters, and read the response headers and decode the resonse stream using the correct InputStream implementation.
The method is called twice from the parseSldParam(GetMapRequest request) method.

I have not added test cases as the test would depend on having a remote server with gzip support.

--
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