Skip to content

Commit

Permalink
feat: etag with cache-control (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
BCsabaEngine authored Aug 21, 2024
1 parent abb1360 commit c5270a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cppCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down Expand Up @@ -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}}
Expand Down

0 comments on commit c5270a8

Please sign in to comment.