We construct and evaluate a modular assessment for students' knowledge about CPU cache memories. Caches play a key role in improving performance in modern computing. They are difficult for students to learn, but we have little conceptual or empirical evidence about why. Building on prior frameworks, we propose six underlying knowledge components that we believe students need to robustly evaluate how a cache can affect the performance of code on a processor. We constructed a modular assessment using these components that can be used as a diagnostic instrument to find the concepts students are struggling to understand. Because different institutions teach caches at varying depths of detail, individual modules of the assessment can be used by instructors and researchers as appropriate for their context. We evaluated the assessment using a combination of Classical Test Theory, Exploratory Factor Analysis, and Confirmatory Factor Analysis. Our results suggest that the assessment is reliable and can be used modularly to assess various components of students' knowledge about caches, though future work needs to be done to evaluate the validity of these modules at different institutions. This assessment can help instructors and researchers design more precisely targeted instructional interventions to help students learn caches. The creation of similar modular assessments may help us in improving instruction in other difficult topics in computing.