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