Patch cache key generating functions to respect host.

This fixes #18 and refs #8 that was the first attempt but failed due to the lack of support for threading. The patch will only applied on Django < 1.7.