0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Disabled caching for ActivityPub & WebFinger

ref https://linear.app/tryghost/issue/MOM-25

Whilst we're experimenting it's gonna be easier to not have to think about
caching affecting things. We'll disable it completely for now, and then decide
on a caching strategy that suits us down the line.
This commit is contained in:
Fabien O'Carroll 2024-04-18 17:26:20 +07:00 committed by Fabien 'egg' O'Carroll
parent e8ea2e4db0
commit 9e98be9268
2 changed files with 6 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import {Controller, Get, Param} from '@nestjs/common';
import {Controller, Get, Header, Param} from '@nestjs/common';
import {Roles} from '../../../common/decorators/permissions.decorator';
import ObjectID from 'bson-objectid';
import {JSONLDService} from '../../../core/activitypub/jsonld.service';
@ -9,6 +9,7 @@ export class ActivityPubController {
private readonly service: JSONLDService
) {}
@Header('Cache-Control', 'no-store')
@Roles(['Anon'])
@Get('actor/:id')
async getActor(@Param('id') id: unknown) {
@ -18,6 +19,7 @@ export class ActivityPubController {
return this.service.getActor(ObjectID.createFromHexString(id));
}
@Header('Cache-Control', 'no-store')
@Roles(['Anon'])
@Get('key/:owner')
async getKey(@Param('owner') owner: unknown) {
@ -27,6 +29,7 @@ export class ActivityPubController {
return this.service.getPublicKey(ObjectID.createFromHexString(owner));
}
@Header('Cache-Control', 'no-store')
@Roles(['Anon'])
@Get('outbox/:owner')
async getOutbox(@Param('owner') owner: unknown) {

View file

@ -1,4 +1,4 @@
import {Controller, Get, Query} from '@nestjs/common';
import {Controller, Get, Header, Query} from '@nestjs/common';
import {WebFingerService} from '../../../core/activitypub/webfinger.service';
@Controller('.well-known/webfinger')
@ -7,6 +7,7 @@ export class WebFingerController {
private readonly service: WebFingerService
) {}
@Header('Cache-Control', 'no-store')
@Get('')
async getResource(@Query('resource') resource: unknown) {
if (typeof resource !== 'string') {