21

Is there a SDCH (Shared Dictionary Compression over HTTP) library for Node? (Or any other implementations for that matter?)

A quick search on npm yielded nothing.

josh3736
  • 139,160
  • 33
  • 216
  • 263
  • Is it just on papers, or there is an implementations of it? – Farid Nouri Neshat Jul 25 '12 at 17:01
  • 2
    @alFReDNSH: Chrome implements SDCH decompression. What's really needed is a Node module that implements the VCDIFF algorithm, which is what SDCH uses to compress data. Chrome's implementation was open-sourced as [open-vcdiff](http://code.google.com/p/open-vcdiff/). – josh3736 Aug 04 '12 at 17:57
  • 1
    A dirty and not really perfect implementation would be to spawn the binary command, pipe data to it, and then pipe the result to HTTP. This has an overhead due to creating the process and reading the dictionary file. I think a better one would be to write node bindings for it and then create it as a separate(since I think it's CPU intensive and blocks the event loop, though not measured) node process, and pipe data over IPC or STDIN and STDOUT. – Farid Nouri Neshat Aug 04 '12 at 18:13
  • 1
    Given that I'd like to use this on a high-load server, performance is paramount. I don't think spawning a separate process will yield acceptable results. That's why I'm looking for a VCDIFF module that works exactly like Node's zlib module. The module does the computationally expensive compression on a separate thread; it does not block the event loop, nor does it incur the overhead of IPC. – josh3736 Aug 04 '12 at 18:29
  • @niutech: [That project doesn't actually have any code.](https://code.google.com/p/mod-sdch/source/browse/#svn%2Ftrunk) – josh3736 Nov 08 '13 at 20:32

1 Answers1

1

Looks lik this is still in a very early phases, and nothing out there seems to have an internal implementation (apache, nginx, etc)

Here is a JS library implementing VCDIFF https://github.com/plotnikoff/vcdiff.js. But there doesn't seem to be anything to implement the content negotiation with Chrome.

Ryan Gibbons
  • 3,511
  • 31
  • 32
  • I've seen that library. Of course doing the compression in JavaScript means you're doing the heavy computational lifting on the event loop thread, which makes is a very bad thing. – josh3736 May 02 '13 at 03:26