3
0
Fork 0
forked from mirrors/nixpkgs
Nix Packages collection
Go to file
Dee Anzorge f124c73686 nginx: change etags for statically compressed files served from store
Per RFC 9110, [section 8.8.1][1], different representations of the same
resource should have different Etags:

> A strong validator is unique across all versions of all
> representations associated with a particular resource over time.
> However, there is no implication of uniqueness across representations
> of different resources (i.e., the same strong validator might be in
> use for representations of multiple resources at the same time and
> does not imply that those representations are equivalent)

When serving statically compressed files (ie, when there is an existing
corresponding .gz/.br/etc. file on disk), Nginx sends the Etag marked
as strong. These tags should be different for each compressed format
(as shown in  an explicit example in section [8.8.3.3][2] of the RFC).
Upstream Etags are composed of the file modification timestamp and
content length, and the latter generally changes between these
representations.

Previous implementation of Nix-specific Etags for things served from
store used the store hash. This is fine to share between different
files, but it becomes a problem for statically compressed versions of
the same file, as it means Nginx was serving different representations
of the same resource with the same Etag, marked as strong.

This patch addresses this by imitating the upstream Nginx behavior, and
appending the value of content length to the store hash.

[1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-validator-fields
[2]:
https://www.rfc-editor.org/rfc/rfc9110.html#name-example-entity-tags-varying
2024-01-13 22:07:50 +01:00
.github maintainers/teams: remove adisbladis from podman 2023-12-27 02:13:24 +13:00
doc nginx: change etags for statically compressed files served from store 2024-01-13 22:07:50 +01:00
lib Merge pull request #276271 from hercules-ci/modules-types-description-nonRestrictiveClause 2023-12-30 17:29:16 +01:00
maintainers Merge pull request #278100 from necessarily-equal/remove-bookletimposer 2024-01-03 01:02:32 +13:00
nixos nginx: change etags for statically compressed files served from store 2024-01-13 22:07:50 +01:00
pkgs nginx: change etags for statically compressed files served from store 2024-01-13 22:07:50 +01:00
.editorconfig documentation-highlighter: 9.12.0 -> 11.9.0, add new langs 2023-12-02 00:07:26 +01:00
.git-blame-ignore-revs
.gitattributes
.gitignore
.mailmap maintainers: stepbrobd change email and fingerprint 2023-12-06 13:07:16 -05:00
.version 24.05 is Uakari 2023-11-21 14:34:30 -05:00
CONTRIBUTING.md CONTRIBUTING.md: Dedent warnings until GitHub fixes it 2023-12-06 04:04:01 +01:00
COPYING
default.nix
flake.nix flake.nix: Add caveats 2023-12-30 11:25:54 +01:00
README.md Release NixOS 23.11 2023-11-29 12:17:49 -05:00

NixOS logo NixOS logo

Contributors badge Open Collective supporters

Nixpkgs is a collection of over 80,000 software packages that can be installed with the Nix package manager. It also implements NixOS, a purely-functional Linux distribution.

Manuals

  • NixOS Manual - how to install, configure, and maintain a purely-functional Linux distribution
  • Nixpkgs Manual - contributing to Nixpkgs and using programming-language-specific Nix expressions
  • Nix Package Manager Manual - how to write Nix expressions (programs), and how to use Nix command line tools

Community

Other Project Repositories

The sources of all official Nix-related projects are in the NixOS organization on GitHub. Here are some of the main ones:

  • Nix - the purely functional package manager
  • NixOps - the tool to remotely deploy NixOS machines
  • nixos-hardware - NixOS profiles to optimize settings for different hardware
  • Nix RFCs - the formal process for making substantial changes to the community
  • NixOS homepage - the NixOS.org website
  • hydra - our continuous integration system
  • NixOS Artwork - NixOS artwork

Continuous Integration and Distribution

Nixpkgs and NixOS are built and tested by our continuous integration system, Hydra.

Artifacts successfully built with Hydra are published to cache at https://cache.nixos.org/. When successful build and test criteria are met, the Nixpkgs expressions are distributed via Nix channels.

Contributing

Nixpkgs is among the most active projects on GitHub. While thousands of open issues and pull requests might seem a lot at first, it helps consider it in the context of the scope of the project. Nixpkgs describes how to build tens of thousands of pieces of software and implements a Linux distribution. The GitHub Insights page gives a sense of the project activity.

Community contributions are always welcome through GitHub Issues and Pull Requests.

For more information about contributing to the project, please visit the contributing page.

Donations

The infrastructure for NixOS and related projects is maintained by a nonprofit organization, the NixOS Foundation. To ensure the continuity and expansion of the NixOS infrastructure, we are looking for donations to our organization.

You can donate to the NixOS foundation through SEPA bank transfers or by using Open Collective:

License

Nixpkgs is licensed under the MIT License.

Note: MIT license does not apply to the packages built by Nixpkgs, merely to the files in this repository (the Nix expressions, build scripts, NixOS modules, etc.). It also might not apply to patches included in Nixpkgs, which may be derivative works of the packages to which they apply. The aforementioned artifacts are all covered by the licenses of the respective packages.