peek/peek — pull request #30 by dewski (2013-05-06 04:47:13+00:00)
Title: Persist Request Payload

Peek currently only aggregates and is aware of anything that happens before the `peek/results` partial is rendered. As long as the partial is the last thing rendered before the closing body tag, it will be fairly accurate. What it _doesn't_ take into account is anything that happens after the request is done. For example, anything that is executed within an `after_filter` before the requests is finished. This can become a big problem in the future, but it was by design.

A better way to solve this problem would be to use the request's `env['action_dispatch.request_id']` to store any and all data that is collected throughout the request. Once the request is finished (full page, turbolinks, pjax) it will send an AJAX request to `/peek/results?request_id=` to fetch the result payload used to update the Peek bar.

The data can be stored in various adapters, in memory by default. You can configure Peek to use a different adapter per environment if you like. The following adapters will be made available in `peek/peek`:

- [ ] Memory adapter (default)
- [ ] Redis adapter
- [ ] Memcache adapter

TODO:

- [ ] Update README about how to use any non memory adapter