File tree Expand file tree Collapse file tree 5 files changed +29
-9
lines changed
Expand file tree Collapse file tree 5 files changed +29
-9
lines changed Original file line number Diff line number Diff line change @@ -7,5 +7,6 @@ namespace NodeJS {
77 KEY : string ;
88 NEXT_PUBLIC_GA_MEASUREMENT_ID : string ;
99 NEXT_PUBLIC_ORIGIN : string ;
10+ NEXT_PUBLIC_ASSET_VERSION : string ;
1011 }
1112}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { pretendardFont } from '@/app/_fonts';
99import ClientProvider from '@/components/global/ClientProvider' ;
1010import Footer from '@/components/global/Footer' ;
1111import Navigation from '@/components/global/Navigation' ;
12+ import { ASSET_VERSION } from '@/libs/constants/assetVersion' ;
1213import { DEFAULT_METADATA } from '@/libs/constants/metadata' ;
1314
1415import styles from './layout.module.scss' ;
@@ -19,18 +20,21 @@ function RootLayout({ children }: { children: React.ReactNode }) {
1920 return (
2021 < html lang = "ko" className = { pretendardFont . className } >
2122 < head >
22- < link rel = "mask-icon" href = "/assets/safari-pinned-tab.svg" />
23+ < link
24+ rel = "mask-icon"
25+ href = { `/assets/safari-pinned-tab.svg?v=${ ASSET_VERSION } ` }
26+ />
2327 < link
2428 rel = "icon"
2529 type = "image/png"
2630 sizes = "32x32"
27- href = " /assets/favicon-32x32.png"
31+ href = { ` /assets/favicon-32x32.png?v= ${ ASSET_VERSION } ` }
2832 />
2933 < link
3034 rel = "icon"
3135 type = "image/png"
3236 sizes = "16x16"
33- href = " /assets/favicon-16x16.png"
37+ href = { ` /assets/favicon-16x16.png?v= ${ ASSET_VERSION } ` }
3438 />
3539 </ head >
3640 < body >
Original file line number Diff line number Diff line change 11import { MetadataRoute } from 'next' ;
22
3+ import { ASSET_VERSION } from '@/libs/constants/assetVersion' ;
4+
35function manifest ( ) : MetadataRoute . Manifest {
46 return {
57 name : 'SIPE' ,
@@ -11,27 +13,27 @@ function manifest(): MetadataRoute.Manifest {
1113 theme_color : '#131518' ,
1214 icons : [
1315 {
14- src : ' /favicon.ico' ,
16+ src : ` /favicon.ico?v= ${ ASSET_VERSION } ` ,
1517 sizes : '48x48' ,
1618 type : 'image/x-icon' ,
1719 } ,
1820 {
19- src : ' /assets/favicon-16x16.png' ,
21+ src : ` /assets/favicon-16x16.png?v= ${ ASSET_VERSION } ` ,
2022 sizes : '16x16' ,
2123 type : 'image/png' ,
2224 } ,
2325 {
24- src : ' /assets/favicon-32x32.png' ,
26+ src : ` /assets/favicon-32x32.png?v= ${ ASSET_VERSION } ` ,
2527 sizes : '32x32' ,
2628 type : 'image/png' ,
2729 } ,
2830 {
29- src : ' /assets/android-chrome-192x192.png' ,
31+ src : ` /assets/android-chrome-192x192.png?v= ${ ASSET_VERSION } ` ,
3032 sizes : '192x192' ,
3133 type : 'image/png' ,
3234 } ,
3335 {
34- src : ' /assets/android-chrome-512x512.png' ,
36+ src : ` /assets/android-chrome-512x512.png?v= ${ ASSET_VERSION } ` ,
3537 sizes : '512x512' ,
3638 type : 'image/png' ,
3739 } ,
Original file line number Diff line number Diff line change 1+ /**
2+ * 자산 캐시 무효화를 위한 버전 관리
3+ *
4+ * - Vercel 환경: NEXT_PUBLIC_ASSET_VERSION 환경 변수 사용
5+ * - 로컬 개발: 현재 날짜 기반 버전 사용
6+ *
7+ * 외부 플랫폼(Notion, Slack 등)의 메타데이터 캐시를 무효화하기 위해
8+ * OG 이미지, favicon 등의 경로에 버전 파라미터로 추가됩니다.
9+ */
10+ export const ASSET_VERSION =
11+ process . env . NEXT_PUBLIC_ASSET_VERSION || 'sipe-5th' ;
Original file line number Diff line number Diff line change 11import { Metadata } from 'next' ;
22
3+ import { ASSET_VERSION } from './assetVersion' ;
4+
35const title = 'SIPE' ;
46const description = '개발자들이 함께 교류하며 성장하는 IT 커뮤니티' ;
5- const images = [ ' /assets/logos/og-image.png' ] ;
7+ const images = [ ` /assets/logos/og-image.png?v= ${ ASSET_VERSION } ` ] ;
68const defaultURL = process . env . NEXT_PUBLIC_ORIGIN ;
79const metadataBase = new URL ( defaultURL ) ;
810
You can’t perform that action at this time.
0 commit comments