drupflare/worker - v1.0.0
    Preparing search index...

    Function pageMirrorKey

    • The R2 key for one page.

      THE GENERATION IS IN THE KEY, and that is the decision this module turns on. With it, invalidation is a single counter bump -- every old key is simply never read again -- instead of one R2 delete per path, which would be a Class A operation each and would have to enumerate the paths to delete. The cost is orphaned objects, which staleGenerationPrefix exists to sweep. site.ts already keys its edge cache the same way, so the two tiers agree.

      A path is percent-encoded rather than passed through: R2 keys tolerate most bytes, but a raw ? or # would make the object unaddressable over HTTP on a custom domain, which is the entire point of putting it there.

      Parameters

      • site: string
      • generation: number
      • path: string

      Returns string