파생 이미지 캐시 재검증 적용
This commit is contained in:
@@ -8,7 +8,8 @@ import {
|
||||
import {
|
||||
getPostBodyPreviewThumbnailUrl,
|
||||
getPostBodyThumbnailUrl,
|
||||
getPostLightboxThumbnailUrl
|
||||
getPostLightboxThumbnailUrl,
|
||||
withGeneratedImageCacheVersion
|
||||
} from '../../lib/post-card-thumbnail-url.js'
|
||||
import { readEditableTextFromElement, setEditableCaretOffset } from '../../lib/markdown-inline.js'
|
||||
import {
|
||||
@@ -1059,14 +1060,26 @@ const contentLightboxImages = computed(() => {
|
||||
* @param {string|null|undefined} imageUrl - 원본 이미지 URL
|
||||
* @returns {string} 표시용 이미지 URL
|
||||
*/
|
||||
const getContentDisplayImageUrl = (imageUrl) => getPostBodyThumbnailUrl(imageUrl) || imageUrl || ''
|
||||
const getContentDisplayImageUrl = (imageUrl) => {
|
||||
const bodyThumbnailUrl = getPostBodyThumbnailUrl(imageUrl)
|
||||
|
||||
return bodyThumbnailUrl
|
||||
? withGeneratedImageCacheVersion(bodyThumbnailUrl)
|
||||
: imageUrl || ''
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시물 라이트박스용 이미지 URL을 조회한다.
|
||||
* @param {string|null|undefined} imageUrl - 원본 이미지 URL
|
||||
* @returns {string} 라이트박스용 이미지 URL
|
||||
*/
|
||||
const getContentLightboxImageUrl = (imageUrl) => getPostLightboxThumbnailUrl(imageUrl) || imageUrl || ''
|
||||
const getContentLightboxImageUrl = (imageUrl) => {
|
||||
const lightboxThumbnailUrl = getPostLightboxThumbnailUrl(imageUrl)
|
||||
|
||||
return lightboxThumbnailUrl
|
||||
? withGeneratedImageCacheVersion(lightboxThumbnailUrl)
|
||||
: imageUrl || ''
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시물 본문 이미지의 반응형 srcset을 만든다.
|
||||
@@ -1078,8 +1091,8 @@ const getContentDisplayImageSrcset = (imageUrl) => {
|
||||
const bodyUrl = getPostBodyThumbnailUrl(imageUrl)
|
||||
|
||||
return [
|
||||
previewUrl ? `${previewUrl} 720w` : '',
|
||||
bodyUrl ? `${bodyUrl} 1600w` : ''
|
||||
previewUrl ? `${withGeneratedImageCacheVersion(previewUrl)} 720w` : '',
|
||||
bodyUrl ? `${withGeneratedImageCacheVersion(bodyUrl)} 1600w` : ''
|
||||
].filter(Boolean).join(', ')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user