From 6b7bfa3cff2fb0d530a99897a2e48a77f2994c0b Mon Sep 17 00:00:00 2001 From: Sergiu Date: Sun, 28 Dec 2025 15:02:29 +0200 Subject: [PATCH] fix(modules): prevent ISR from caching 404 error responses --- app/pages/modules/index.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/pages/modules/index.vue b/app/pages/modules/index.vue index 0f33a5567..d2cf0987e 100644 --- a/app/pages/modules/index.vue +++ b/app/pages/modules/index.vue @@ -15,8 +15,13 @@ const { replaceRoute } = useFilters('modules') const { fetchList, filteredModules, q, categories, modules, stats, selectedSort, selectedOrder, selectedCategory, sorts } = useModules() const { track } = useAnalytics() +const cacheControl = useResponseHeader('Cache-Control') +const cdnCacheControl = useResponseHeader('CDN-Cache-Control') + const { data: page } = await useAsyncData('modules-landing', () => queryCollection('landing').path('/modules').first()) if (!page.value) { + cacheControl.value = 'no-store, no-cache, must-revalidate' + cdnCacheControl.value = 'no-store' throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true }) }