Skip to content

[FEATURE REQUEST] Use ETag in Salt Fileclient for HTTP sources #61270

Closed

Description

@nicholasmhughes

For any states which can provide a http:// or https:// source file, the file is always downloaded and cached on the minion before a determination can be made whether the file has changed. For large files, this can introduce long wait times in state runs.

Describe the solution you'd like
Ideally, the minion would try to perform a HEAD on the file to get the ETag and compare that to the last cached file if present. If the ETag differs, the file would then be downloaded. Otherwise, the file client would use the cached copy.

Describe alternatives you've considered
/shrug

Additional context
This feature might warrant a gate option in the minion config since it'll fundamentally change the operation of remote web sources for multiple states.

Please Note
If this feature request would be considered a substantial change or addition, this should go through a SEP process here https://github.com/saltstack/salt-enhancement-proposals, instead of a feature request.

Activity

  1. added
    Feature
    on Nov 19, 2021
  2. OrangeDog commented on Nov 22, 2021

    @OrangeDog
    Contributor

    A extra HEAD request is unnecessary. Use the If-None-Match header.

  3. added a commit that references this issue on Jan 10, 2022
    015af75
  4. added a commit that references this issue on Jan 10, 2022
    3b71ef4
  5. added a commit that references this issue on Jan 21, 2022
    232876c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Featureneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions