As you already note you'd need to bypass batching. How I would implement this:
- Perform "normal" query, unbatched.
- Randomize full result list. Is going to impact performance since you need to unpack the whole result iterator.
- Wrap the randomized result in a memoize. Here you decide whether to differentiate by user and how long you cache, by the way you define the memoization cache key.
- Then wrap that memoized randomized result into a batcher.
So the whole question of "storing a random ordering" here is solved by memoize, and you can define arbitrary policies by including cookies or other request variables into the cache key of that memoizer.
Hope that makes any sense?
Guido Stevens | +31.43.3618933 | http://cosent.nl
s o c i a l k n o w l e d g e t e c h n o l o g y