caching and django-lean

24 views
Skip to first unread message

bfrederi

unread,
Feb 10, 2011, 12:41:35 PM2/10/11
to django-lean
How does django-lean work around django's built-in caching?

Erik Wright

unread,
Feb 10, 2011, 1:32:46 PM2/10/11
to djang...@googlegroups.com
It doesn't do anything special.

It's non-trivial depending on the number of experiments you have running and the percentage of your users that you are enrolling in experiments.

If you check experiment state while generating a cacheable artifact, you should include the experiment enrollment (test/control) in the cache key.

If you only have a few experiments at any time, you could reasonably store the entire set of experiment enrollments (i.e., dict containing one entry per active experiment) in all cache keys. But this will result in some number of false cache misses. Also, IIRC users are not enrolled in experiments unless they encounter them, so retrieving the user's enrollment in all experiments would artificially inflate the population sizes for your tests.

Either approach would introduce complications if you also rely on explicitly expiring cache entries.

Good luck!

-Erik
Reply all
Reply to author
Forward
0 new messages