ttl for bandcamp albums.

This commit is contained in:
Bradley Shellnut 2024-12-13 13:39:13 -08:00
parent 9ec7b8c188
commit ccee169078

View file

@ -11,10 +11,10 @@ export async function fetchBandcampAlbums() {
if (cached) {
const response: Album[] = JSON.parse(cached);
console.log(`Cache hit!`);
console.log('Albums cache hit!');
const ttl = await redis.ttl('bandcampAlbums');
return response;
return { ...response, cacheControl: `max-age=${ttl}` };
}
}