Skip to content

feat: add last modified and digest metadata to standalone API#12526

Merged
bzp2010 merged 8 commits into
apache:masterfrom
bzp2010:bzp/feat-standalone-api-metadata-headers
Aug 18, 2025
Merged

feat: add last modified and digest metadata to standalone API#12526
bzp2010 merged 8 commits into
apache:masterfrom
bzp2010:bzp/feat-standalone-api-metadata-headers

Conversation

@bzp2010

@bzp2010 bzp2010 commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

Description

  1. Add a new metadata response header to the Standalone API. This includes X-Last-Modified and X-Digest.
    They are used to report to a cluster of multiple APISIX instances, which instance was last updated, and the configuration digest currently in use.
    The X-Digest is passed in by the PUT request and recorded in memory, and then output in the response header of a GET or HEAD request. This value is transparent to APISIX, which does not parse or generate the value in any way; it is completely controlled by the client. There is a simple judgment here; if the digest input for the PUT request matches what is currently stored in memory, the API will return 204, and the configuration update will not actually occur.

  2. Add support for the HEAD method, which returns only metadata but not configuration.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

I explicitly point out that this is not backwards compatible. Since this feature is clearly marked as experimental and users have been warned not to rely on it, we can comfortably make the changes we need.

@bzp2010
bzp2010 marked this pull request as ready for review August 14, 2025 20:50
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Aug 14, 2025
@SkyeYoung

Copy link
Copy Markdown
Member

Please fix the errors reported in the CI.

Comment thread apisix/admin/standalone.lua

@SkyeYoung SkyeYoung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others LGTM

Comment thread apisix/admin/standalone.lua
Comment thread apisix/admin/standalone.lua
@bzp2010
bzp2010 merged commit eadaa7a into apache:master Aug 18, 2025
53 of 55 checks passed
jizhuozhi pushed a commit to jizhuozhi/apisix that referenced this pull request Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants