Add selector cache to improve performance.