Home / Function/ getCachedDocument() — supabase Function Reference

getCachedDocument() — supabase Function Reference

Architecture documentation for the getCachedDocument() function in getDocument.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  e77004fb_c899_5274_2cb1_829839a631c9["getCachedDocument()"]
  898e75d6_b289_83d1_ddd4_0b7fa7700ee7["getDocument()"]
  e77004fb_c899_5274_2cb1_829839a631c9 -->|calls| 898e75d6_b289_83d1_ddd4_0b7fa7700ee7
  style e77004fb_c899_5274_2cb1_829839a631c9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/cms/src/utilities/getDocument.ts lines 29–41

export const getCachedDocument = (collection: Collection, slug: string) => {
  return async () => {
    try {
      const { unstable_cache } = await import('next/cache')
      const cached = unstable_cache(async () => getDocument(collection, slug), [collection, slug], {
        tags: [`${collection}_${slug}`],
      })
      return cached()
    } catch {
      return getDocument(collection, slug)
    }
  }
}

Subdomains

Frequently Asked Questions

What does getCachedDocument() do?
getCachedDocument() is a function in the supabase codebase.
What does getCachedDocument() call?
getCachedDocument() calls 1 function(s): getDocument.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free