perf(backend): cache avatar and banner url to db
This commit is contained in:
parent
de9d136a3f
commit
521eb95dbc
28 changed files with 126 additions and 183 deletions
|
@ -149,13 +149,12 @@ export class ServerService implements OnApplicationShutdown {
|
|||
host: (host == null) || (host === this.config.host) ? IsNull() : host,
|
||||
isSuspended: false,
|
||||
},
|
||||
relations: ['avatar'],
|
||||
});
|
||||
|
||||
reply.header('Cache-Control', 'public, max-age=86400');
|
||||
|
||||
if (user) {
|
||||
reply.redirect(this.userEntityService.getAvatarUrlSync(user));
|
||||
reply.redirect(user.avatarUrl ?? this.userEntityService.getIdenticonUrl(user));
|
||||
} else {
|
||||
reply.redirect('/static-assets/user-unknown.png');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue