The Caching Expensive GlideRecord Queries pattern addresses performance bottlenecks caused by repeatedly executing the same costly database operations. When multiple users or processes frequently query the same relatively static data, each execution hits the database unnecessarily, creating scalability issues and poor response times.
This pattern implements strategic caching at different scopes using ServiceNow's built-in caching mechanisms. GlideSystemCache provides instance-wide caching for data that changes infrequently, session-scoped variables cache data for individual user sessions, and Script Include static properties offer transaction-scoped caching. The pattern automatically handles cache invalidation and provides fallback mechanisms when cached data is unavailable.