-1

My server is sending a lot of duplicate strings, packed with gzip. Can I get that all the duplicates will be compressed to one instance?

Thank in advice!

4

1 回答 1

0

Sure. Just write some code on the server to do it.

You need to use some semi-permanent storage on the server to map duplicates. APC would probably do the job. Do something like this:

Generate a hash of your strings and then use that as the storage key, if the entry already exists, then there's your duplicate. So you can simply increase the entry count and then send that count along with a copy of the string.

If indeed this is the question you are asking in the first place...

于 2012-11-13T14:04:23.070 回答