diff --git a/tools/harbor_sbom_browser/src/handlers/artifact_tree.rs b/tools/harbor_sbom_browser/src/handlers/artifact_tree.rs index 98f19d8..4b99a8d 100644 --- a/tools/harbor_sbom_browser/src/handlers/artifact_tree.rs +++ b/tools/harbor_sbom_browser/src/handlers/artifact_tree.rs @@ -49,6 +49,7 @@ lazy_static! { pub async fn render_as_html( State(cached_rendered_artifact_tree): State>>, ) -> Result, ArtifactTreeError> { + // if the artifact tree is already cached, return it if let Some(html) = cached_rendered_artifact_tree.get() { return Ok(html); @@ -57,7 +58,67 @@ pub async fn render_as_html( let artifact_tree = build_artifact_tree().await?; let mut html = String::with_capacity(64 * 1024); // reserve 64KB to avoid reallocations - html.push_str("