chore: reduce cache ttl

This commit is contained in:
Innei
2021-09-19 17:33:36 +08:00
parent 7a4978c617
commit f1b608a2a7
3 changed files with 5 additions and 6 deletions

View File

@@ -171,7 +171,7 @@ export class MarkdownController {
@Get('/render/:id')
@Header('content-type', 'text/html')
@HTTPDecorators.Bypass
@CacheTTL(60 * 60 * 24)
@CacheTTL(60 * 60)
async renderArticle(@Param() params: MongoIdDto) {
const { id } = params
const now = performance.now()

View File

@@ -1,5 +1,4 @@
import { Controller, Get, Header } from '@nestjs/common'
import { HttpCache } from '~/common/decorator/cache.decorator'
import { CacheTTL, Controller, Get, Header } from '@nestjs/common'
import { HTTPDecorators } from '~/common/decorator/http.decorator'
import { ApiName } from '~/common/decorator/openapi.decorator'
import { ConfigsService } from '../configs/configs.service'
@@ -20,7 +19,7 @@ export class PageProxyController {
@Get('/qaqdmin')
@Header('Content-Type', 'text/html')
@HTTPDecorators.Bypass
@HttpCache({ disable: true })
@CacheTTL(60 * 10)
async proxyAdmin() {
const {
adminExtra,

View File

@@ -42,7 +42,7 @@ export class ToolController {
}
@Get('geocode/location')
@CacheTTL(1000 * 60 * 60 * 24)
@CacheTTL(60 * 60 * 24)
async callGeocodeLocationApi(@Query() query: GaodeMapLocationDto) {
const { latitude, longitude } = query
const data = await this.toolService.getGeoLocationByGaode(
@@ -52,7 +52,7 @@ export class ToolController {
return data
}
@CacheTTL(1000 * 10)
@CacheTTL(10)
@Get('geocode/search')
async callGeocodeSearchApi(@Query() query: GaodeMapSearchDto) {
let { keywords } = query