If compression is setup on tomcat, will it also compress data that is uploaded by the client – via browser/applet ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, it won’t. It only applies on the server response. The client has to compress the request data itself. It makes no sense to send the data from the client uncompressed over network to the server first and then compress over there. It won’t have any benefits (i.e. saving network bandwidth and so on).
Compression of HTTP requests is however not part of the HTTP specification since a client can’t know beforehand if a server would support it. It has to fire a whole request first. It’s only specified for the HTTP responses. The server can determine based on the
Accept-Encodingrequest header if the client supports compression or not and then handle accordingly.In an applet, you can consider to send the data compressed using
GZIPOutputStream. You’ll only need to develop a specific servlet on the server side which listens on requests from the applet only and knows that it needs to decompress theHttpServletRequest#getInputStream()accordingly usingGZIPInputStream