feat: move some stuff around
This commit is contained in:
@ -126,14 +126,20 @@ const GET = async (
|
||||
|
||||
console.log("[api/image] resized image", { imageUrl });
|
||||
|
||||
cache.setImage(modifiedImage, {
|
||||
await cache.setImage(modifiedImage, {
|
||||
url: imageUrl,
|
||||
width: params.width,
|
||||
height: params.height,
|
||||
mediaType: remoteImage.mediaType,
|
||||
});
|
||||
|
||||
return new Response(modifiedImage, {
|
||||
const cachedImage = await cache.getImage({
|
||||
url: imageUrl,
|
||||
width: params.width,
|
||||
height: params.height,
|
||||
});
|
||||
|
||||
return new Response(cachedImage.data || modifiedImage, {
|
||||
headers: {
|
||||
"Content-Type": remoteImage.mediaType,
|
||||
},
|
||||
|
Reference in New Issue
Block a user