ui-refs.c: Simplify and inline cmp_age()

In comparison functions, only the sign of the return value matters -- no
need to have extra checks to ensure the return value always is +/-1 when
the actual parameters differ. After removing all the checks, the
function body boils down to

    return age2 - age1;

so we can as well replace all invocations with that subtraction.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Skip cache slot when time-to-live is zero

If time-to-live is set to zero, we don't need to regenerate the cache
slots on every request. Instead, just skip the caching process and
immediately provide the dynamically generated version of the page.
Setting time-to-live to zero is useful when you want to disable caching
for certain pages.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Add a cache-snapshot-ttl configuration variable

This can be used to specify the TTL for snapshots. Snapshots are usually
static and do not ever change. On the other hand, tarball generation is
CPU intensive.

One use case of this setting (apart from increasing the lifetime of
snapshot cache slots) is caching of snapshots while disabling the cache
for static/dynamic HTML pages (by setting TTL to zero for everything
except for snapshot requests).

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Remove unused parameter from cgit_print_snapshot()

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>