Don't create cache if no posts.

createPostsCache() won't create a cache if there are no posts. It now
also has better checking of having no posts.