spring-cloud / spring-cloud/spring-cloud-config

Add ETag support to both server and client

Open
#2,034 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted waiting for votes
Dominant language
Java
Stars
2k
Forks
1.3k
Avg merge
2d 59m
Merged PRs (30d)
16

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Spring Web server response path and the client configuration reload path; review how the Git environment repository exposes the commit ID and how HEAD responses are handled. Done means the server can return ETags, including the Git commit ID where applicable, and the client uses them to avoid unnecessary configuration fetches.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java, spring, spring-boot
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.