selector cache pattern