Skip to content

Conversation

@backportbot
Copy link

@backportbot backportbot bot commented Feb 9, 2024

Backport of PR #11472

Nginx resets all response headers in a location block, if it contains any "add_header" directive. When setting the "Cache-Control" header for static assets, this was originally worked around by using the "expires" directive instead. #8083 however added the "immutable" flag for assets with "v=" query parameter and broke all other response headers for assets that way.

This commit fixes this by re-adding all reponse headers explicitly for those assets. Originally those doubled code was removed thanks to using "expires", but I see no way to have both: the "immutable" flag as well as avoiding doubled headers via "expires" directive.

Additionally, this commit avoids the trailing comma and space in the Cache-Control header for assets without "v=" query parameter, and adds sets the wasm MIME type in a cleaner/more consistent way together with js/mjs, and rephrases the broken comment sentence.

Signed-off-by: MichaIng <micha@dietpi.com>
@MichaIng MichaIng merged commit 055873a into stable28 Feb 9, 2024
@MichaIng MichaIng deleted the backport/11472/stable28 branch February 9, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants