Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/doc/src/reference/registry-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The keys are:
`/{crate}/{version}/download` is appended to the end.
- `api`: This is the base URL for the web API. This key is optional, but if it
is not specified, commands such as [`cargo publish`] will not work. The web
API is described below.
API is described below. This URL should not have a trailing slash.
- `auth-required`: indicates whether this is a private registry that requires
all operations to be authenticated including API requests, crate downloads
and sparse index updates.
Expand Down Expand Up @@ -307,7 +307,7 @@ can go to get a token.
Registries that require authentication must set `auth-required: true` in `config.json`.

#### Caching
Cargo caches the crate metadata files, and captures the `ETag` or `Last-Modified`
Copy link
Copy Markdown
Member

@weihanglo weihanglo Apr 11, 2026

Choose a reason for hiding this comment

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

View changes since the review

This trailing space cleanup should be in a separate commit. Anyway, looks good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Whoops, sorry about that. My editor did it, I made sure not to include it the first time around, and wasn't as vigilant the second time

Cargo caches the crate metadata files, and captures the `ETag` or `Last-Modified`
HTTP header from the server for each entry. When refreshing crate metadata, Cargo
sends the `If-None-Match` or `If-Modified-Since` header to allow the server to respond
with HTTP 304 "Not Modified" if the local cache is valid, saving time and bandwidth.
Expand All @@ -325,7 +325,7 @@ or 451 "Unavailable For Legal Reasons" code.

#### Sparse Limitations
Since the URL of the registry is stored in the lockfile, it's not recommended to offer
a registry with both protocols. Discussion about a transition plan is ongoing in issue
a registry with both protocols. Discussion about a transition plan is ongoing in issue
[#10964]. The [crates.io] registry is an exception, since Cargo internally substitutes
the equivalent git URL when the sparse protocol is used.

Expand Down