added caching headers
This commit is contained in:
parent
1cb957c1ab
commit
2da91c6623
1 changed files with 5 additions and 0 deletions
|
@ -112,6 +112,11 @@ export class LocalFiles {
|
||||||
app.get("/ciderlocalart/:songs", (req: any, res: any) => {
|
app.get("/ciderlocalart/:songs", (req: any, res: any) => {
|
||||||
const audio = req.params.songs;
|
const audio = req.params.songs;
|
||||||
// metadata.common.picture[0].data.toString('base64')
|
// metadata.common.picture[0].data.toString('base64')
|
||||||
|
|
||||||
|
res.setHeader('Cache-Control', 'public, max-age=31536000');
|
||||||
|
res.setHeader('Expires', new Date(Date.now() + 31536000).toUTCString());
|
||||||
|
res.setHeader('Content-Type', 'image/jpeg');
|
||||||
|
|
||||||
let data =
|
let data =
|
||||||
LocalFiles.localSongsArts.filter((f: any) => f.id == audio);
|
LocalFiles.localSongsArts.filter((f: any) => f.id == audio);
|
||||||
res.status(200).send(Buffer.from(data[0]?.url, 'base64'));
|
res.status(200).send(Buffer.from(data[0]?.url, 'base64'));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue