mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-06 20:16:57 +00:00
match preview cache duration for HTTP and Redis
This commit is contained in:
parent
387efac23f
commit
163be8d4a4
1 changed files with 4 additions and 4 deletions
|
@ -126,8 +126,8 @@ export class UrlPreviewService {
|
|||
const cached = await this.previewCache.get(cacheKey);
|
||||
if (cached !== undefined) {
|
||||
this.logger.info(`Returning cache preview of ${cacheKey}`);
|
||||
// Cache 7days
|
||||
reply.header('Cache-Control', 'max-age=604800, immutable');
|
||||
// Cache 1 day (matching redis)
|
||||
reply.header('Cache-Control', 'public, max-age=86400');
|
||||
|
||||
if (cached.activityPub) {
|
||||
cached.haveNoteLocally = !! await this.apDbResolverService.getNoteFromApId(cached.activityPub);
|
||||
|
@ -179,8 +179,8 @@ export class UrlPreviewService {
|
|||
|
||||
this.previewCache.set(cacheKey, summary);
|
||||
|
||||
// Cache 7days
|
||||
reply.header('Cache-Control', 'max-age=604800, immutable');
|
||||
// Cache 1 day (matching redis)
|
||||
reply.header('Cache-Control', 'public, max-age=86400');
|
||||
|
||||
return summary;
|
||||
} catch (err) {
|
||||
|
|
Loading…
Add table
Reference in a new issue