Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
WebSocketの圧縮機能とSocket.IO
Search
Naoyuki Kanezawa
February 10, 2015
Technology
9.5k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WebSocketの圧縮機能とSocket.IO
websocketのpermessage-deflate extensionについて
Naoyuki Kanezawa
February 10, 2015
Transcript
29 slides
WebSocketの圧縮機能と Socket.IO 2/10 Node学園#15
ID: nkzawa socket.io コミッター
最近 ws モジュールに permessage-deflate extension を実装しました
wsモジュール nodeのデファクトwebsocket server/client socket.ioでも使用している
古くからあるissueを解決 ws#34 3年前 socket.io#1148 2年前
None
None
permessage-deflate とは
メッセージデータを deflate 圧縮する WebSocketの拡張
HTTPでいうところのgzip圧縮
None
None
permessage-deflate vs http compression
最も重要な違い http: レスポンスにのみ適用 websocket: 双方向
圧縮パラメータ http: 圧縮データのheaderに含める websocket: ハンドシェイク時に交換
windowBits: ウィンドウ・サイズ noContextTakeOver: コンテキストを引き継ぐかどうか
Context Takeover 各メッセージを同一コンテキストで圧縮すること で圧縮率を改善
None
残念なお知らせ
現状Chromeのみサポート ( FireFoxはv37から )
ブラウザでは設定変更ができない JSのWebSocket APIにインターフェースがないため、 常に有効かつデフォルト値で動作する。
謝辞
この機能に関連するNodeの脆弱性を、 @jovi0608 (Shigeki Ohtsu) さん に直していただいたおかげで、 無事リリースできました!m(__)m
socket.io では
次バージョン (v1.4) でサポートされます。 (そもそもsocket.ioのために実装した)
• 圧縮がデフォルトで有効 • polling時はhttp圧縮 • メッセージ毎にon/offを切り替え可能
var socket = io({ perMessageDeflate: true, httpCompression: true }); socket.compress(false).emit(‘woot’);
まとめ
• 地味な機能だけど、パフォーマンス改善にイ ンパクトは大きいはず! • Socket.IOでも近いうちにサポート!
More Decks by Naoyuki Kanezawa
See All by Naoyuki Kanezawa
Introducing Now and Next.js
nkzawa
12
5.7k
Socket.IO 1.0 Client for Javaの紹介
nkzawa
5
1.9k
Socket.IO 1.0の変更点・内部的な話
nkzawa
20
9.4k
Other Decks in Technology
See All in Technology
[関西Kaggler会 20261113] 続・コミュニティコンペのススメ
nejumi
0
150
PHPで家庭用ゲーム機の専用コントローラーをMIDIデバイスとして扱ってみる
wind111
0
150
設計手法を「道具」として使いこなすために
a_suenami
4
870
あの日、見つかっていなかったらどうなっていたか
kazzpapa3
2
260
AI対話型分析を作成し、リリースするまでの話 / The Road to Release: Buiding AI Conversational Analytics
yappli_developers
0
170
cdkdがどんだけ早いか、実際に動かして見てみよう
smt7174
1
130
ぼくのClaude Codeの使い方
falken
PRO
5
7.5k
農家は秘伝のタレを知らない - NOBODY KNOWS THE HIDDEN SOURCE - Kaggriculture 3rd Place Solution
masspeaks
2
530
Gov-JAWS#9 統合監視機能のマネージドサービス化+AIによる障害時自動調査
fj_yoshimura_kosuke
0
210
こんなに変わった! AWSネットワークの常識
shotashiratori
16
10k
Context != Context: One window, many lifecycles (AI Native DevCon, Nov 2026)
birgitta410
0
160
IP重複は"ランディングVPC"で受け止める ― PrivateLink と Transit Gatewayによるマルチテナント接続基盤の設計
hatahata021
3
250
Featured
See All Featured
From π to Pie charts
rasagy
1
450
Utilizing Notion as your number one productivity tool
mfonobong
4
650
エンジニアに許された特別な時間の終わり
watany
109
250k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Abbi's Birthday
coloredviolet
5
11k
A designer walks into a library…
pauljervisheath
211
25k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
The agentic SEO stack - context over prompts
schlessera
0
1k
We Have a Design System, Now What?
morganepeng
55
8.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
320