Match URLs to cache server

This commit is contained in:
kwaroran
2024-01-06 22:21:45 +09:00
parent c3d7210cc3
commit e974b5ee7f

View File

@@ -21,6 +21,12 @@ async function initTransformers(){
},
match: async (url:URL|string) => {
console.log('match', url)
if(typeof url === 'string'){
if(url.startsWith('/tf/Xenova/')){
const newURL = 'https://sv.risuai.xyz/transformers/' + url.substring(11)
await tfCache.add(newURL)
}
}
return await tfCache.match(url)
}
}