Home / Function/ set() — astro Function Reference

set() — astro Function Reference

Architecture documentation for the set() function in route-cache.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  1908c3bf_4f4b_9edf_2e46_d7f8234fb45b["set()"]
  f2590c8b_da5c_804e_e7c6_accc3dae27c1["RouteCache"]
  1908c3bf_4f4b_9edf_2e46_d7f8234fb45b -->|defined in| f2590c8b_da5c_804e_e7c6_accc3dae27c1
  048344ff_c9c7_2ece_8c6f_f290d78d8649["callGetStaticPaths()"]
  048344ff_c9c7_2ece_8c6f_f290d78d8649 -->|calls| 1908c3bf_4f4b_9edf_2e46_d7f8234fb45b
  62817829_3a39_357e_33b8_9060451fad09["key()"]
  1908c3bf_4f4b_9edf_2e46_d7f8234fb45b -->|calls| 62817829_3a39_357e_33b8_9060451fad09
  style 1908c3bf_4f4b_9edf_2e46_d7f8234fb45b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/render/route-cache.ts lines 104–113

	set(route: RouteData, entry: RouteCacheEntry): void {
		const key = this.key(route);
		// NOTE: This shouldn't be called on an already-cached component.
		// Warn here so that an unexpected double-call of getStaticPaths()
		// isn't invisible and developer can track down the issue.
		if (this.runtimeMode === 'production' && this.cache[key]?.staticPaths) {
			this.logger.warn(null, `Internal Warning: route cache overwritten. (${key})`);
		}
		this.cache[key] = entry;
	}

Domain

Subdomains

Calls

Frequently Asked Questions

What does set() do?
set() is a function in the astro codebase, defined in packages/astro/src/core/render/route-cache.ts.
Where is set() defined?
set() is defined in packages/astro/src/core/render/route-cache.ts at line 104.
What does set() call?
set() calls 1 function(s): key.
What calls set()?
set() is called by 1 function(s): callGetStaticPaths.

Analyze Your Own Codebase

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

Try Supermodel Free