Add skeleton for twigg-cache gem

We're going to be adding a new gem to the Twigg family, twigg-cache. If
you want Twigg to go fast, install this gem and we'll cache results in a
Memcached instance for you.

We're doing it this way to avoid re-inventing the wheel (ie. if we were
to make a crude in-process cache store we'd have to re-implement expiry
semantics and so on).

Having at as a separate gem means that people without the means to run
Memcache can still use Twigg without bloating their dependency footprint
(this gem drags in the dalli gem as a dependency).

Change-Id: I027770547f8d2e32df6730d43af05207c97c3880
Reviewed-on: https://gerrit.causes.com/27302
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Use briefer badge URLs in README

There's no sense in using the badges for the twigg-gerrit gem in the
main README; we should use the twigg gem badges.

Change-Id: I44fd159767f0b090571ded222a1c4d047455d93a
Reviewed-on: https://gerrit.causes.com/27303
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Add Twigg::Cacher wrapper

This class will mediate all access to the real underlying cache.

If enabled and the twigg-cache gem is present, it connects to Memcache
via Dalli. Otherwise, it uses a dummy client that treats every cache
lookup as a miss.

Change-Id: I4544b3a536e3e44c236cfb5e0a6b3852c0f63cfc
Reviewed-on: https://gerrit.causes.com/27304
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Commit noise in Gemfile.lock

Hopefully this will be the last time Bundler decides that the items in
the Gemfile.lock need to be rearranged...

Change-Id: I4c8178ca01c2c4c5e7829119a21df5a554d3a299
Reviewed-on: https://gerrit.causes.com/27305
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Mark another item in the twiggrc template as a default value

Change-Id: I03ba3e239b293499c4382e267f94ab375d34171e
Reviewed-on: https://gerrit.causes.com/27306
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Teach Twigg::Cacher to add an arg-based digest to cache keys

With this modification we can easily use the same cache key for multiple
different calls to a given `Cacher.get` block and they will all be
caching independently.

I'll be using this presently to add the first caching to Twigg's web
app.

Change-Id: I4293c3cfbb84af1b4221061d925544a46bf38fa4
Reviewed-on: https://gerrit.causes.com/27307
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Teach /authors to use cache

Note that we don't bother making the repos directory a part of the cache
key, as this shouldn't change from run to run of the app. (Arguably, a
case could be made for it, but it definitely falls under the realm of
edge case and so we're not going to worry about it for now.)

Change-Id: If6fd517dfdd68aa5958e8bce3b547ea95d9bd6c5
Reviewed-on: https://gerrit.causes.com/27308
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Make it possible to override Memcached max object size

The Memcached default is 1M, but some objects we would want to cache are
almost twice as large as that, even when compressed. For example, the
180-day /authors view at Causes currently has about 8,000 commits in its
commit set. This takes a little under 2M of memory when serialized and
compressed (about 237 bytes per commit).

Ideally we would break this down into smaller chunks and store them
separately, but for now, in the name of simplicity, I am just going to
make it possible pass through a value_max_value to the underlying Dalli
client. As most people likely won't want to set this, I don't provide a
default value.

In order for this to work, the `-I` option must be passed through to
Memcached at startup. For example, if Twigg is configured with a
value_max_bytes of 4194304, then Memcached should be started with `-I
4m`.

Change-Id: Ifa58c05cc6979ce0f9ae233f7846df4188003422
Reviewed-on: https://gerrit.causes.com/27309
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Add caching to most other app actions

I haven't touched the Gerrit actions because they are all pretty fast
even without caching, but pretty much all the others have been hit with
the cache stick.

This makes things nice and snappy if you click around.

Note the expiry time is 1 hour, by default, so if you stop clicking
around, things will get slow.

Change-Id: I8e418f44461c4776cbfcf7322a725a50450bd013
Reviewed-on: https://gerrit.causes.com/27310
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>
Prepare for 0.0.2 release

Bump version number and updated CHANGELOG.

Change-Id: Iead06fceb29ad1852418dc0b81309a5738374c41
Reviewed-on: https://gerrit.causes.com/27311
Reviewed-by: Greg Hurrell <greg@causes.com>
Tested-by: Greg Hurrell <greg@causes.com>