substack/seaport — pull request #3 by mbrevoort (2012-04-01 18:42:08+00:00)
Title: Cached Queries

I added a `cache.query` function to the client and simple caching for each `roleVer` that was previously retrieved. The server fires `invalidateCache` on the clients after `allocate`, `assume` or `free`. To reduce the chattiness of the `invalidateCache` calls to clients that don't care, caching could be turned on optionally when the client connects. If disabled, calls to `cache.query` would just pass through to `query` and the server wouldn't call `invalidateCache` for that client remote. I wanted to see what you thought of the approach first before going that far though.