Since someone websocket subscriptions will use an iden of 2 for
state_changed event (most comment), and some will use another
number for all events, the cache would not be used because the
iden number was different. We now cache only the event and
use a fast replace to insert the iden number into the serailized
response.
Since most of the json serialize work for the websocket was done
multiple times for the same message, we can avoid the overhead
of serializing the same message many times (once per websocket
client) with a cache.