Cache issue, probably because ref is not in cache key

To reproduce it:
 * do a query on a given ref
 * do the same query on another ref

Both responses are the same, and are what should be returned by the first query.

I guess the ref is simply not a part of the cache key. I'll look at it today. We should ship it quickly.