[mirror] Scalable static site server for Git forges (like GitHub Pages)

Fetch manifests in parallel when handling GET requests.

miyuko c39e57a8 3863f0f1

+8 -2
+8 -2
src/pages.go
··· 87 87 return err 88 88 } 89 89 90 + indexManifestCh := make(chan *Manifest, 1) 91 + go func() { 92 + manifest, _ := backend.GetManifest(r.Context(), makeWebRoot(host, ".index"), 93 + GetManifestOptions{BypassCache: bypassCache}) 94 + indexManifestCh <- manifest 95 + }() 96 + 90 97 sitePath = strings.TrimPrefix(r.URL.Path, "/") 91 98 if projectName, projectPath, found := strings.Cut(sitePath, "/"); found { 92 99 projectManifest, err := backend.GetManifest(r.Context(), makeWebRoot(host, projectName), ··· 96 103 } 97 104 } 98 105 if manifest == nil { 99 - manifest, err = backend.GetManifest(r.Context(), makeWebRoot(host, ".index"), 100 - GetManifestOptions{BypassCache: bypassCache}) 106 + manifest = <-indexManifestCh 101 107 if manifest == nil { 102 108 if found, fallbackErr := HandleWildcardFallback(w, r); found { 103 109 return fallbackErr