ETag support with pre-gzipped content stored in static variables #220
Replies: 1 comment 1 reply
-
Yes, that's the call we're using. The tradeoff of making the ETag generation implicit is that every user ends up paying the cost of doing the check, even though in many real scenarios the code knows the outcome (either way!) statically at compile time. I'm not sure I'm in the best position to make that call for all use cases - @mathieucarbou what do you think?
If we do want implicit analysis, I'd suggest going the other way around -- do the magic number check if and only if the callback is unset, ie. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
willmmiles commented about ETag support form FS files:
I assume the function you're using is beginResponse(int code, const char *contentType, const uint8_t *content, size_t len, AwsTemplateProcessor callback).
The simplest option would be to use the void send(int code, const char *contentType, const uint8_t *content, size_t len, AwsTemplateProcessor callback = nullptr) function.
The strategy might be to check if the content has the GZIP Magic number (to make sure it is a gz content). If so, use eTag and disable AwsTemplateProcessor callback.
This way, it wouldn't be necessary to create new functions, and the improvement would work in the existing code.
Beta Was this translation helpful? Give feedback.
All reactions