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}}