Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/blocks/runtime/caches/tiered.ts>createTieredCache

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Go to Latest
function createTieredCache
import { createTieredCache } from "https://deno.land/x/blocks@1.102.1/runtime/caches/tiered.ts";

Creates a tiered cache that combines multiple cache storages into a single cache storage. The tiered cache will prioritize the caches in the order they are provided. When a request is made to the tiered cache, it will first check if the request is available in any of the caches. If a match is found, the response will be returned and the caches will be updated based on the cache priority. If no match is found, the request will be fetched and stored in the caches based on the cache priority.

Parameters

...tieredCaches: CacheStorage[]

The cache storages to be combined into the tiered cache.

Returns

The tiered cache storage.