Compress a string in JavaScript using GZIP?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Compress a string in JavaScript using GZIP?

Post by JAB Creations »

I'm interested in checking the length of form data being submitted. It will be stored as a GZIP compressed string in a cookie. However to help reduce bandwidth/server load I'd like to (if possible) compress the string with JavaScript. I know you can obviously test the length of a string...it's the compression part I'm not sure of. I need to ensure via JavaScript that the string is not longer then 4085 characters in length after compression which is the absolute maximum amount of data that can be accepted.
Post Reply