How to cache a different page version based on HTTP header?

How to cache a different page version based on HTTP header?