On Monday, January 6, 2025 at 4:46:51 PM UTC+1 Colin Alworth wrote:
Take a little care with testing/validating etag though - stock Jetty at least does not hash the file to produce this (to avoid the expense of reading the entire file to produce the hash, then re-reading it from start to stream it), but uses the file modification date assuming is a valid proxy for changes.
Apache HTTPD (https://httpd.apache.org/docs/2.4/mod/core.html#fileetag) and Nginx (https://github.com/nginx/nginx/blob/e3a9b6ad08a86e799a3d77da3f2fc507d3c9699e/src/http/ngx_http_core_module.c#L1701-L1704) do something similar
Thwarting this, gradle helpfully sets file metadata in a jar/war to a point decades in the past, regardless of actual values, to ensure its own caching isn't impacted by files being refreshed.
Gradle doesn't do that by default, this is part of an explicit configuration to get reproducible builds: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html#org.gradle.api.tasks.bundling.Jar:preserveFileTimestamps
You'd have the same issues with Bazel (does reproducible builds by default) or Maven (https://maven.apache.org/guides/mini/guide-reproducible-builds.html)
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/66ce266f-b68c-4471-955e-9f8949063200n%40googlegroups.com.
No comments:
Post a Comment