New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP compressed value can't process #173
Comments
The module doesn't support compressed values as it has no logic to unzip the compressed information. |
Is there any option to compress.decompress the data using node memcached module instead of storing raw data ? |
@kazzalib unfortunately, each memcached client tends to use the So, one option is to pre-gzip your data (might need to base64 it too) in PHP and store it as a string to memcached? Then you'll get a string back in node and can un-gzip it. |
I was able to fix a similar issue. We were facing same kind of php compressed data. Have a look at the diff file below, (It may sound like a nasty fix with a lot of side effects, but works like a charm in our case). We were unable to change original php code due to backward compatibility limitations with existing php code base. Works good for both case, compressed and non compressed.
|
Actually php has two different sets of encoding depending on... who knows... it will either encode with zlib or fastlz. I have this small diff for the memcache part and attached the code for the fastlz bit (adapted from a couple which can only compress) I am not pushing this as a feature request, as it was said often, every single developer uses it's own compression for memcache, and we can't put all of them in here, but it might help someone |
Hi,
We have faced an issue when the key is stored via php with compression it can't process in memcached module.
php code: Memcache::set ( "SampleKey" , "Sample value" , MEMCACHE_COMPRESSED , 2000);
undefined:1
x����N� �
^
SyntaxError: Unexpected token x
at Object.parse (native)
at Socket.value (/usr/local/lib/node_modules/memcached/lib/memcached.js:497:26)
at Client.rawDataReceived (/usr/local/lib/node_modules/memcached/lib/memcached.js:708:51)
at Client.BufferBuffer (/usr/local/lib/node_modules/memcached/lib/memcached.js:654:12)
at Socket.bowlofcurry (/usr/local/lib/node_modules/memcached/lib/utils.js:108:15)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket. (stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5
The text was updated successfully, but these errors were encountered: