HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback

Query caching is useful, for example, to make [search-based implementations more resilient](🔗). Search requests can be cached for a certain duration using the `StaticallyCacheFor` method, which accepts a timespan. No cache key is required because the search request will generate one.

The following code returns a previously cached result or executes the query and caches the result for five minutes.

You can also cache results with a dependency (`System.Web.Caching.Dependency`) using an overload to the `StaticallyCacheFor` method.

**Related blog post:** [Common Find caching pitfalls](🔗)