정적 자산 캐싱 문제를 해결하기 위한 간단한 우회 방법을 소개합니다.
Nginx 리버스 프록시 캐싱을 사용하던 중 정적 파일의 캐시 문제를 경험했습니다. 이를 해결하기 위해 빌드 시마다 변경되는 쿼리 지문을 자산 경로에 추가하는 효과적인 방법을 사용했습니다. CI 단계에서 지문을 생성하고 이를 Nginx 구성에 반영함으로써 캐시를 완전히 무효화했습니다.
A simple workaround is introduced to fix static asset caching issues.
While using Nginx reverse proxy caching for static files, an issue with stale files arose post-deployment. A crude yet effective workaround was implemented by adding a changing query fingerprint to the asset path with each build. This solution involved generating a fingerprint in the CI step and updating the Nginx configuration, which effectively broke the cache so that CDN edge nodes refreshed properly.