diff --git a/src/AkteApp.ts b/src/AkteApp.ts index d7b97f8..82d7025 100644 --- a/src/AkteApp.ts +++ b/src/AkteApp.ts @@ -90,7 +90,7 @@ export class AkteApp { this.config = config; - debug("created with %o files", this.config.files.length); + debug("defined with %o files", this.config.files.length); if (isCLI) { runCLI(this as AkteApp); diff --git a/src/AkteFiles.ts b/src/AkteFiles.ts index 2edea06..9c36fd2 100644 --- a/src/AkteFiles.ts +++ b/src/AkteFiles.ts @@ -115,7 +115,7 @@ export class AkteFiles< constructor(definition: FilesDefinition) { this.definition = definition; - debug("created %o", this.path); + debug("defined %o", this.path); } /** @internal Prefer {@link AkteApp.render} or use at your own risks. */ diff --git a/src/vite/plugins/serverPlugin.ts b/src/vite/plugins/serverPlugin.ts index c70bc80..d0e9a6c 100644 --- a/src/vite/plugins/serverPlugin.ts +++ b/src/vite/plugins/serverPlugin.ts @@ -142,8 +142,11 @@ export const serverPlugin = ( target: `http://${req.headers.host}/${options.cacheDir}/render`, }); - // Revalidate cache if cache was used - if (match.globalData || match.data) { + // Revalidate cache on non-fetch requests if cache was used + if ( + req.headers["sec-fetch-dest"] === "empty" && + (match.globalData || match.data) + ) { revalidateCache(match); } });