fix(core): 공개 템플릿 config 캐시 무효화 누락과 확장 캐시 삭제 경로 동종 결함 정비

공개 config.json 의 고정 캐시 키(template.config.{identifier})가 어떤 갱신
경로에서도 forget 되지 않아 template:update/cache-clear/비활성화/삭제 후에도
최대 1시간(TTL) 이전 manifest 로 응답되던 결함(공개 )을 수정한다.

- TemplateManager::clearTemplateCache 공개화 — config/components_manifest(두
 변종)/현재 버전 routes·language 키 능동 forget, updateTemplate cleanup 호출
- forgetLayoutCacheKeys 가 편집기용 .with_source_meta 변종까지 삭제
- ext.cache_version 쓰기를 incrementExtensionCacheVersion 단일 지점으로 통일
- module/plugin:cache-clear 의 유령 키 forget 을 실재 캐시(레이아웃 서빙/해석
 캐시, 상태 키, 미들웨어 인덱스, 버전 bump) 무효화로 교체
- 공개 routes/language/layout API 의 ?v 생략 폴백을 0 → 현재 버전으로 교정
This commit is contained in:
HeuJung committed 2026-08-17 13:22:48 +09:00
1 parent 09a700e4c7
commit e819db9d42
27 files changed
+891 -247

No files matched your search

@@ -2,9 +2,9 @@
namespace App\Services;
use App\Contracts\Extension\CacheInterface;
use App\Contracts\Repositories\TemplateCustomTranslationRepositoryInterface;
use App\Exceptions\ConcurrentModificationException;
use App\Extension\Traits\ClearsTemplateCaches;
use App\Models\TemplateCustomTranslation;
use App\Services\LanguagePack\CustomTranslationUsageScanner;
use Illuminate\Database\Eloquent\Collection;
@@ -22,10 +22,12 @@ use Illuminate\Database\QueryException;
* - seq 충돌 시 재시도 (unique 제약 위반 → seq 증가)
* - 신규 키 생성 시 모든 활성 로케일에 폴백 시드
* - 낙관적 잠금 (`lock_version` — update 경로)
* - 커스텀 키 CRUD 시 다국어 캐시 무효화
* - 커스텀 키 CRUD 시 다국어 캐시 무효화
*/
class TemplateCustomTranslationService
{
use ClearsTemplateCaches;
/**
* seq 충돌 재시도 최대 횟수.
*/
@@ -33,11 +35,9 @@ class TemplateCustomTranslationService
/**
* @param TemplateCustomTranslationRepositoryInterface $repository 커스텀 다국어 키 리포지토리
* @param CacheInterface $cache 캐시 드라이버
*/
public function __construct(
private readonly TemplateCustomTranslationRepositoryInterface $repository,
private readonly CacheInterface $cache,
) {}
/**
@@ -287,11 +287,12 @@ class TemplateCustomTranslationService
*
* `serveLanguage` 캐시 키가 `template.language.{id}.{locale}.v{cacheVersion}`
* 형태로 `ext.cache_version` 을 포함하므로, 이 값을 갱신하면 다음
* `loadTranslations` 가 재fetch 합니다.
* `loadTranslations` 가 재fetch 합니다. 쓰기는 트레이트 단일 지점
* (고정 CoreCacheDriver + 메모이즈 스토어) 경유.
*/
private function invalidateLanguageCache(): void
{
$this->cache->put('ext.cache_version', time());
$this->incrementExtensionCacheVersion();
}
/**