From c5270a8218c826adfade3af268371905bf39c4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Csaba=20Bal=C3=A1zs?= Date: Wed, 21 Aug 2024 10:19:18 +0200 Subject: [PATCH] feat: etag with cache-control (#26) --- src/cppCode.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cppCode.ts b/src/cppCode.ts index a3d1bd2..29f51bb 100644 --- a/src/cppCode.ts +++ b/src/cppCode.ts @@ -167,10 +167,12 @@ void {{methodName}}(PsychicHttpServer * server) { {{#switch ../etag}} {{#case "true"}} + response.addHeader("cache-control", "no-cache"); response.addHeader("ETag", etag_{{this.dataname}}); {{/case}} {{#case "compiler"}} #ifdef {{../definePrefix}}_ENABLE_ETAG + response.addHeader("cache-control", "no-cache"); response.addHeader("ETag", etag_{{this.dataname}}); #endif {{/case}} @@ -346,10 +348,12 @@ void {{methodName}}(AsyncWebServer * server) { {{#switch ../etag}} {{#case "true"}} + response->addHeader("cache-control", "no-cache"); response->addHeader("ETag", etag_{{this.dataname}}); {{/case}} {{#case "compiler"}} #ifdef {{../definePrefix}}_ENABLE_ETAG + response->addHeader("cache-control", "no-cache"); response->addHeader("ETag", etag_{{this.dataname}}); #endif {{/case}}