Is your feature request related to a problem? Please describe. The ETag is not returned from the server's API. There is no configuration to enable it. The client doesn't make use of ETag at all.
Describe the solution you'd like
The ETag header can be easily added to the response header using the ShallowEtagHeaderFilter
of Spring Web. This calculates the value from the response body. In case of GIT being configured as the environment repository, the ETag can be set to the value of the commit ID of the given label. This would simplify the ETag calculation (i.e. doesn't need to resolve all files) and would add the possibility to return ETag in the HEAD response body.
The client can then consider the ETag to figure out if it needs to fetch the configuration from the server again. This is useful in the configuration reload use cases.
Describe alternatives you've considered none
Additional context n/a
Comment From: StitzL
I have a working implementation of the general requirement that passes the tests, and could submit a PR if you'd like. Essentially, it was sufficient to add ShallowEtagHeaderFilter
to EnvironmentRepositoryConfiguration
.
To implement the specific solution based on Git commit hashes, I'd need a pointer to the code locations where I could conveniently get hold of these. If you could give me a rough idea, I'd be happy to add that as well.