Add cache to raw file api

This commit is contained in:
Lee 2022-11-17 09:03:08 +00:00
parent 0fcad4d421
commit 605c075083
No known key found for this signature in database
GPG Key ID: 6EA25896ECCB3121

@ -16,6 +16,7 @@ export default async function handler(req, res) {
}
res.setHeader("Content-Type", file.contentType); // Set the content type header
res.setHeader("Cache-control", "public, max-age=3600"); // Cache the file for 1 hour
readStream.pipe(res); // Send the file to the client
}