Reduce the query count by one per page when using SiteConfiguration.

SiteConfiguration always looked up self.site to build the cache key,
which did a query for the proper Site. However, in every realistic case,
that's going to be equal to Site.objects.get_current(), which either
will have been fetched at that point, or soon would be anyway.

We now fetch this and, if it's the ID we expect, we set the current
instance to it. That reduces an unnecessary query per request.
Don't query for objects in a response when we know the count is 0.

When building a paginated webapi response, we would always perform a
query for the count and a query for the objects. The latter query is
pointless if the count is 0, so only do it if we know there are objects
to fetch.
Cache calculated values when we know they won't change.

We frequently get the name and name_plural properties of an API
resource. In the case where a resource doesn't explicitly set them, we
calculate them, and we do this every time it's accessed, even though
it'll never change. Instead, cache these values and only calculate them
once.