diff --git a/README.md b/README.md index ead8b02..d5c30e1 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@
- + docs/sample.svg @@ -59,7 +59,7 @@ ### 등장 가능한 펫들 -docs/pets.svg +docs/pets.svg ## diff --git a/src/main/kotlin/org/gitanimals/render/controller/AnimationController.kt b/src/main/kotlin/org/gitanimals/render/controller/AnimationController.kt index 96e8813..56afc4e 100644 --- a/src/main/kotlin/org/gitanimals/render/controller/AnimationController.kt +++ b/src/main/kotlin/org/gitanimals/render/controller/AnimationController.kt @@ -2,8 +2,6 @@ package org.gitanimals.render.controller import jakarta.servlet.http.HttpServletResponse import org.gitanimals.render.app.AnimationFacade -import org.springframework.http.HttpHeaders -import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.RequestMapping @@ -16,8 +14,16 @@ class AnimationController( ) { @GetMapping(value = ["/{username}"], produces = ["image/svg+xml"]) - fun getSvgAnimation(@PathVariable("username") username: String, response: HttpServletResponse): String { - response.setHeader(HttpHeaders.CACHE_CONTROL, "max-age=1") + fun getSvgAnimation( + @PathVariable("username") username: String, + response: HttpServletResponse + ): String { + response.noCache() return animationFacade.getSvgAnimationByUsername(username) } + + fun HttpServletResponse.noCache(): HttpServletResponse { + this.setHeader("Cache-Control", "no-cache, no-store, must-revalidate") + return this + } }