Add redis for caching, first try during a train ride so expect it to not be working yet

This commit is contained in:
Moritz Marquardt 2024-03-24 20:24:32 +01:00
parent b8b9886ee1
commit 5b6eecc75f
12 changed files with 149 additions and 32 deletions

View file

@ -1,6 +1,7 @@
package handler
import (
"github.com/OrlovEvgeny/go-mcache"
"net/http"
"path"
"strings"
@ -19,7 +20,7 @@ func handleCustomDomain(log zerolog.Logger, ctx *context.Context, giteaClient *g
trimmedHost string,
pathElements []string,
firstDefaultBranch string,
dnsLookupCache, canonicalDomainCache, redirectsCache cache.ICache,
dnsLookupCache *mcache.CacheDriver, canonicalDomainCache, redirectsCache cache.ICache,
) {
// Serve pages from custom domains
targetOwner, targetRepo, targetBranch := dns.GetTargetFromDNS(trimmedHost, mainDomainSuffix, firstDefaultBranch, dnsLookupCache)