mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36: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);
|
const cached = await this.previewCache.get(cacheKey);
|
||||||
if (cached !== undefined) {
|
if (cached !== undefined) {
|
||||||
this.logger.info(`Returning cache preview of ${cacheKey}`);
|
this.logger.info(`Returning cache preview of ${cacheKey}`);
|
||||||
// Cache 7days
|
// Cache 1 day (matching redis)
|
||||||
reply.header('Cache-Control', 'max-age=604800, immutable');
|
reply.header('Cache-Control', 'public, max-age=86400');
|
||||||
|
|
||||||
if (cached.activityPub) {
|
if (cached.activityPub) {
|
||||||
cached.haveNoteLocally = !! await this.apDbResolverService.getNoteFromApId(cached.activityPub);
|
cached.haveNoteLocally = !! await this.apDbResolverService.getNoteFromApId(cached.activityPub);
|
||||||
|
@ -179,8 +179,8 @@ export class UrlPreviewService {
|
||||||
|
|
||||||
this.previewCache.set(cacheKey, summary);
|
this.previewCache.set(cacheKey, summary);
|
||||||
|
|
||||||
// Cache 7days
|
// Cache 1 day (matching redis)
|
||||||
reply.header('Cache-Control', 'max-age=604800, immutable');
|
reply.header('Cache-Control', 'public, max-age=86400');
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue