From cf44f7908d74e56744135e4c8b37ce74dd9d55a6 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Mon, 10 Jun 2024 16:07:40 +0200 Subject: [PATCH 1/3] [Static Web Assets] Fix compressed endpoint headers Fixes the headers for the compressed endpoints during compression negotiation to ensure that the correct headers are set for the endpoints that perform content negotiation. --- .../Tasks/ApplyCompressionNegotiation.cs | 23 +- .../Tasks/Data/StaticWebAssetPathPattern.cs | 2 + ...ldMinimal_Works.Build.staticwebassets.json | 24 +- ...Minimal_Works.Publish.staticwebassets.json | 52 +- ...iles_AsAssets.Publish.staticwebassets.json | 28 +- ..._Hosted_Works.Publish.staticwebassets.json | 28 +- .../ApplyCompressionNegotiationTest.cs | 824 +++++++++++++++++- .../DefineStaticWebAssetEndpointsTest.cs | 120 +++ .../ResolveCompressedAssetsTest.cs | 55 ++ ...sScopedCssFiles.Build.staticwebassets.json | 91 +- ...esPublishAssets.Build.staticwebassets.json | 91 +- ...PublishAssets.Publish.staticwebassets.json | 186 +--- ...tToOutputFolder.Build.staticwebassets.json | 91 +- ...mClassLibraries.Build.staticwebassets.json | 91 +- ...tToOutputFolder.Build.staticwebassets.json | 91 +- ..._NoDependencies.Build.staticwebassets.json | 91 +- ...1ClassLibraries.Build.staticwebassets.json | 79 +- ...pointsForAssets.Build.staticwebassets.json | 24 +- ...esPublishAssets.Build.staticwebassets.json | 24 +- ...PublishAssets.Publish.staticwebassets.json | 56 +- ...BasedOnPatterns.Build.staticwebassets.json | 28 +- ...enHasNotChanged.Build.staticwebassets.json | 24 +- ...ent_WhenEnabled.Build.staticwebassets.json | 40 +- ...tToOutputFolder.Build.staticwebassets.json | 24 +- ...WhenFilesChange.Build.staticwebassets.json | 24 +- ...sChange_Updated.Build.staticwebassets.json | 24 +- ...ermediateOutput.Build.staticwebassets.json | 24 +- ...esPublishAssets.Build.staticwebassets.json | 91 +- ...PublishAssets.Publish.staticwebassets.json | 190 +--- ...aryInitializers.Build.staticwebassets.json | 91 +- ...yInitializers.Publish.staticwebassets.json | 186 +--- ...esPublishAssets.Build.staticwebassets.json | 91 +- ...PublishAssets.Publish.staticwebassets.json | 182 +--- ...heRightLocation.Build.staticwebassets.json | 91 +- ...RightLocation.Publish.staticwebassets.json | 186 +--- ...esPublishAssets.Build.staticwebassets.json | 91 +- ...PublishAssets.Publish.staticwebassets.json | 186 +--- ...esPublishAssets.Build.staticwebassets.json | 91 +- ...PublishAssets.Publish.staticwebassets.json | 186 +--- ...1ClassLibraries.Build.staticwebassets.json | 79 +- ...lassLibraries.Publish.staticwebassets.json | 154 +--- ...intsForAssets.Publish.staticwebassets.json | 64 +- ...ublish_Assets.Publish.staticwebassets.json | 52 +- ...esPublishAssets.Build.staticwebassets.json | 24 +- ...PublishAssets.Publish.staticwebassets.json | 56 +- ...esPublishAssets.Build.staticwebassets.json | 24 +- ...PublishAssets.Publish.staticwebassets.json | 56 +- ...esPublishAssets.Build.staticwebassets.json | 24 +- ...PublishAssets.Publish.staticwebassets.json | 56 +- ...RightLocation.Publish.staticwebassets.json | 56 +- ...tToOutputFolder.Build.staticwebassets.json | 24 +- ...tFolder_Rebuild.Build.staticwebassets.json | 24 +- ...reviousVersions.Build.staticwebassets.json | 79 +- ...viousVersions.Publish.staticwebassets.json | 154 +--- 54 files changed, 2348 insertions(+), 2499 deletions(-) diff --git a/src/StaticWebAssetsSdk/Tasks/ApplyCompressionNegotiation.cs b/src/StaticWebAssetsSdk/Tasks/ApplyCompressionNegotiation.cs index d03385ea761e..17a8bcc24837 100644 --- a/src/StaticWebAssetsSdk/Tasks/ApplyCompressionNegotiation.cs +++ b/src/StaticWebAssetsSdk/Tasks/ApplyCompressionNegotiation.cs @@ -29,7 +29,7 @@ public override bool Execute() .ToDictionary(g => g.Key, g => g.ToList()); var compressedAssets = assetsById.Values.Where(a => a.AssetTraitName == "Content-Encoding").ToList(); - var updatedEndpoints = new List(); + var updatedEndpoints = new HashSet(StaticWebAssetEndpoint.RouteAndAssetComparer); var preservedEndpoints = new Dictionary<(string, string), StaticWebAssetEndpoint>(); @@ -89,13 +89,14 @@ public override bool Execute() } Log.LogMessage(MessageImportance.Low, " Updated endpoint '{0}' with Content-Encoding and Vary headers", compressedEndpoint.Route); - if (!updatedEndpoints.Contains(compressedEndpoint)) - { - updatedEndpoints.Add(compressedEndpoint); - } + updatedEndpoints.Add(compressedEndpoint); foreach (var relatedEndpointCandidate in relatedAssetEndpoints) { + if (!IsCompatible(compressedEndpoint, relatedEndpointCandidate)) + { + continue; + } Log.LogMessage(MessageImportance.Low, "Processing related endpoint '{0}'", relatedEndpointCandidate.Route); var encodingSelector = new StaticWebAssetEndpointSelector { @@ -188,7 +189,10 @@ public override bool Execute() { Log.LogMessage(MessageImportance.Low, " Adding endpoint '{0}'", endpoint.AssetFile); } - updatedEndpoints.AddRange(endpoints); + foreach (var endpoint in endpoints) + { + updatedEndpoints.Add(endpoint); + } } } @@ -197,6 +201,13 @@ public override bool Execute() return true; } + private static bool IsCompatible(StaticWebAssetEndpoint compressedEndpoint, StaticWebAssetEndpoint relatedEndpointCandidate) + { + var compressedFingerprint = compressedEndpoint.EndpointProperties.FirstOrDefault(ep => ep.Name == "fingerprint"); + var relatedFingerprint = relatedEndpointCandidate.EndpointProperties.FirstOrDefault(ep => ep.Name == "fingerprint"); + return string.Equals(compressedFingerprint?.Value, relatedFingerprint?.Value, StringComparison.Ordinal); + } + private void ApplyCompressedEndpointHeaders(List headers, StaticWebAssetEndpoint compressedEndpoint, string relatedEndpointCandidateRoute) { foreach (var header in compressedEndpoint.ResponseHeaders) diff --git a/src/StaticWebAssetsSdk/Tasks/Data/StaticWebAssetPathPattern.cs b/src/StaticWebAssetsSdk/Tasks/Data/StaticWebAssetPathPattern.cs index 76706e5968aa..6116de749f4b 100644 --- a/src/StaticWebAssetsSdk/Tasks/Data/StaticWebAssetPathPattern.cs +++ b/src/StaticWebAssetsSdk/Tasks/Data/StaticWebAssetPathPattern.cs @@ -190,6 +190,8 @@ public static StaticWebAssetPathPattern Parse(string rawPath, string assetIdenti } else if (!string.IsNullOrEmpty(part.Value)) { + // Token was embedded, so add it to the dictionary. + dictionary[part.Name] = part.Value; result.Append(part.Value); } else diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_BuildMinimal_Works.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_BuildMinimal_Works.Build.staticwebassets.json index 97d207c89fb7..a74ad6dd9f5b 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_BuildMinimal_Works.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_BuildMinimal_Works.Build.staticwebassets.json @@ -36900,7 +36900,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -36928,9 +36928,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm-minimal.bundle.scp.css.gz" } ] }, @@ -37006,7 +37014,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -37108,7 +37116,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -37136,9 +37144,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm-minimal.styles.css.gz" } ] }, @@ -37214,7 +37230,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_PublishMinimal_Works.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_PublishMinimal_Works.Publish.staticwebassets.json index e5b2940200b2..2aa5f73ac738 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_PublishMinimal_Works.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_PublishMinimal_Works.Publish.staticwebassets.json @@ -5858,7 +5858,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -5886,9 +5886,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm-minimal.bundle.scp.css.gz" } ] }, @@ -5964,7 +5972,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -6011,7 +6019,7 @@ ] }, { - "Route": "blazorwasm-minimal.__fingerprint__.styles.css.gz", + "Route": "blazorwasm-minimal.styles.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\blazorwasm-minimal#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -6056,7 +6064,7 @@ ] }, { - "Route": "blazorwasm-minimal.styles.css.gz", + "Route": "blazorwasm-minimal.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\blazorwasm-minimal#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -6066,7 +6074,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -6094,9 +6102,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm-minimal.styles.css.gz" } ] }, @@ -6172,7 +6188,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -20474,7 +20490,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -20502,9 +20518,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm-minimal.bundle.scp.css.br" } ] }, @@ -20580,7 +20604,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -20682,7 +20706,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -20710,9 +20734,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm-minimal.styles.css.br" } ] }, @@ -20788,7 +20820,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_Publish_DoesNotIncludeXmlDocumentationFiles_AsAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_Publish_DoesNotIncludeXmlDocumentationFiles_AsAssets.Publish.staticwebassets.json index 6f4e3e17ddf8..0ed9c75e0643 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_Publish_DoesNotIncludeXmlDocumentationFiles_AsAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_Publish_DoesNotIncludeXmlDocumentationFiles_AsAssets.Publish.staticwebassets.json @@ -6122,7 +6122,7 @@ ] }, { - "Route": "blazorwasm.__fingerprint__.styles.css.gz", + "Route": "blazorwasm.styles.css.gz", "AssetFile": "${ProjectPath}\\blazorwasm\\obj\\Debug\\${Tfm}\\compressed\\blazorwasm#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -6167,7 +6167,7 @@ ] }, { - "Route": "blazorwasm.styles.css.gz", + "Route": "blazorwasm.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\blazorwasm\\obj\\Debug\\${Tfm}\\compressed\\blazorwasm#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -6177,7 +6177,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -6205,9 +6205,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm.styles.css.gz" } ] }, @@ -6283,7 +6291,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -20785,7 +20793,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -20813,9 +20821,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm.styles.css.br" } ] }, @@ -20891,7 +20907,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_Publish_Hosted_Works.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_Publish_Hosted_Works.Publish.staticwebassets.json index 6f4e3e17ddf8..0ed9c75e0643 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_Publish_Hosted_Works.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_Publish_Hosted_Works.Publish.staticwebassets.json @@ -6122,7 +6122,7 @@ ] }, { - "Route": "blazorwasm.__fingerprint__.styles.css.gz", + "Route": "blazorwasm.styles.css.gz", "AssetFile": "${ProjectPath}\\blazorwasm\\obj\\Debug\\${Tfm}\\compressed\\blazorwasm#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -6167,7 +6167,7 @@ ] }, { - "Route": "blazorwasm.styles.css.gz", + "Route": "blazorwasm.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\blazorwasm\\obj\\Debug\\${Tfm}\\compressed\\blazorwasm#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -6177,7 +6177,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -6205,9 +6205,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm.styles.css.gz" } ] }, @@ -6283,7 +6291,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -20785,7 +20793,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -20813,9 +20821,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "blazorwasm.styles.css.br" } ] }, @@ -20891,7 +20907,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs index fcb11f306879..d7beefe1afe5 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs @@ -1,8 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Globalization; +using System.Text.Json; using Microsoft.AspNetCore.StaticWebAssets.Tasks; using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; using Microsoft.NET.Sdk.StaticWebAssets.Tasks; using Moq; @@ -30,6 +33,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets() "candidate.js", "All", "All", + "original-fingerprint", "original" ), CreateCandidate( @@ -39,6 +43,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets() "candidate.js", "All", "All", + "compressed-fingerprint", "compressed", Path.Combine("wwwroot", "candidate.js"), "Content-Encoding", @@ -115,6 +120,714 @@ string candidate when candidate.EndsWith(Path.Combine("compressed", "candidate.j ]); } + [Fact] + public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints() + { + var now = DateTime.Now; + var errorMessages = new List(); + var buildEngine = new Mock(); + buildEngine.Setup(e => e.LogErrorEvent(It.IsAny())) + .Callback(args => errorMessages.Add(args.Message)); + + List candidateAssets = [ + CreateCandidate( + Path.Combine("wwwroot", "candidate.js"), + "MyPackage", + "Discovered", + "candidate#[.{fingerprint}]?.js", + "All", + "All", + "original-fingerprint", + "original" + ) + ]; + + var compressedTask = new ResolveCompressedAssets + { + BuildEngine = buildEngine.Object, + CandidateAssets = [.. candidateAssets], + Formats = "gzip;brotli", + IncludePatterns = "*.js", + OutputPath = AppContext.BaseDirectory + }; + compressedTask.Execute().Should().BeTrue(); + + var compressedAssets = compressedTask.AssetsToCompress; + compressedAssets[0].SetMetadata(nameof(StaticWebAsset.Fingerprint), "gzip"); + compressedAssets[0].SetMetadata(nameof(StaticWebAsset.Integrity), "compressed-gzip"); + compressedAssets[1].SetMetadata(nameof(StaticWebAsset.Fingerprint), "brotli"); + compressedAssets[1].SetMetadata(nameof(StaticWebAsset.Integrity), "compressed-brotli"); + candidateAssets.AddRange(compressedAssets); + var defineStaticAssetEndpointsTask = new DefineStaticWebAssetEndpoints + { + TestLengthResolver = value => value switch + { + string candidateBr when candidateBr.EndsWith(".br") => 7, + string candidateGz when candidateGz.EndsWith(".gz") => 9, + string candidate when candidate.EndsWith(".js") => 20, + _ => throw new InvalidOperationException() + }, + TestLastWriteResolver = value => now, + BuildEngine = buildEngine.Object, + CandidateAssets = [.. candidateAssets], + ExistingEndpoints = [], + ContentTypeMappings = + [ + new TaskItem("text/javascript", new Dictionary + { + { "Pattern", "*.js" }, + { "Priority", "0" } + }), + new TaskItem("text/javascript", new Dictionary + { + { "Pattern", "*.js.gz" }, + { "Priority", "1" } + }) + ] + }; + defineStaticAssetEndpointsTask.Execute().Should().BeTrue(); + var compressed = defineStaticAssetEndpointsTask.Endpoints; + + var task = new ApplyCompressionNegotiation + { + BuildEngine = buildEngine.Object, + CandidateAssets = [.. candidateAssets], + CandidateEndpoints = compressed, + TestResolveFileLength = value => value switch + { + string candidateBr when candidateBr.EndsWith(".br") => 7, + string candidateGz when candidateGz.EndsWith(".gz") => 9, + string candidate when candidate.EndsWith(".js") => 20, + _ => throw new InvalidOperationException() + } + }; + + // Act + var result = task.Execute(); + + // Assert + result.Should().Be(true); + var endpoints = StaticWebAssetEndpoint.FromItemGroup(task.UpdatedEndpoints); + var expectedEndpoints = new StaticWebAssetEndpoint[] + { + new() + { + Route = "candidate.fingerprint.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.br"), + Selectors = [ + new () + { + Name = "Content-Encoding", + Value = "br", + Quality = "0.125000000000" + } + ], + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + }, + new () + { + Name = "Content-Encoding", + Value = "br" + }, + new () + { + Name = "Content-Length", + Value = "7" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-brotli\u0022" + }, + new () + { + Name = "ETag", + Value = "W/\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "fingerprint", + Value = "fingerprint" + }, + new () + { + Name = "integrity", + Value = "sha256-original" + }, + new () + { + Name = "label", + Value = "candidate.js" + } + ] + }, + new() + { + Route = "candidate.fingerprint.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.gz"), + Selectors = [ + new () + { + Name = "Content-Encoding", + Value = "gzip", + Quality = "0.100000000000" + } + ], + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + }, + new () + { + Name = "Content-Encoding", + Value = "gzip" + }, + new () + { + Name = "Content-Length", + Value = "9" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-gzip\u0022" + }, + new () + { + Name = "ETag", + Value = "W/\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "fingerprint", + Value = "fingerprint" + }, + new () + { + Name = "integrity", + Value = "sha256-original" + }, + new () + { + Name = "label", + Value = "candidate.js" + } + ] + }, + new() + { + Route = "candidate.fingerprint.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot\\candidate.js"), + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + }, + new () + { + Name = "Content-Length", + Value = "20" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + } + ], + EndpointProperties = [ + new () + { + Name = "fingerprint", + Value = "fingerprint" + }, + new () + { + Name = "integrity", + Value = "sha256-original" + }, + new () + { + Name = "label", + Value = "candidate.js" + } + ] + }, + new() + { + Route = "candidate.fingerprint.js.br", + AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.br"), + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + }, + new () + { + Name = "Content-Encoding", + Value = "br" + }, + new () + { + Name = "Content-Length", + Value = "7" + }, + new () + { + Name = "Content-Type", + Value = "application/octet-stream" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-brotli\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "fingerprint", + Value = "fingerprint" + }, + new () + { + Name = "integrity", + Value = "sha256-compressed-brotli" + }, + new () + { + Name = "label", + Value = "candidate.js.br" + } + ] + }, + new() + { + Route = "candidate.fingerprint.js.gz", + AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.gz"), + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + }, + new () + { + Name = "Content-Encoding", + Value = "gzip" + }, + new () + { + Name = "Content-Length", + Value = "9" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-gzip\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "fingerprint", + Value = "fingerprint" + }, + new () + { + Name = "integrity", + Value = "sha256-compressed-gzip" + }, + new () + { + Name = "label", + Value = "candidate.js.gz" + } + ] + }, + new() + { + Route = "candidate.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.br"), + Selectors = [ + new () + { + Name = "Content-Encoding", + Value = "br", + Quality = "0.125000000000" + } + ], + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "no-cache" + }, + new () + { + Name = "Content-Encoding", + Value = "br" + }, + new () + { + Name = "Content-Length", + Value = "7" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-brotli\u0022" + }, + new () + { + Name = "ETag", + Value = "W/\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "integrity", + Value = "sha256-original" + } + ] + }, + new() + { + Route = "candidate.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.gz"), + Selectors = [ + new () + { + Name = "Content-Encoding", + Value = "gzip", + Quality = "0.100000000000" + } + ], + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "no-cache" + }, + new () + { + Name = "Content-Encoding", + Value = "gzip" + }, + new () + { + Name = "Content-Length", + Value = "9" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-gzip\u0022" + }, + new () + { + Name = "ETag", + Value = "W/\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "integrity", + Value = "sha256-original" + } + ] + }, + new() + { + Route = "candidate.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot\\candidate.js"), + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "no-cache" + }, + new () + { + Name = "Content-Length", + Value = "20" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + } + ], + EndpointProperties = [ + new () + { + Name = "integrity", + Value = "sha256-original" + } + ] + }, + new() + { + Route = "candidate.js.br", + AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.br"), + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "no-cache" + }, + new () + { + Name = "Content-Encoding", + Value = "br" + }, + new () + { + Name = "Content-Length", + Value = "7" + }, + new () + { + Name = "Content-Type", + Value = "application/octet-stream" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-brotli\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "integrity", + Value = "sha256-compressed-brotli" + } + ] + }, + new() + { + Route = "candidate.js.gz", + AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.gz"), + ResponseHeaders = [ + new () { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () { + Name = "Cache-Control", + Value = "no-cache" + }, + new () { + Name = "Content-Encoding", + Value = "gzip" + }, + new () { + Name = "Content-Length", + Value = "9" + }, + new () { + Name = "Content-Type", + Value = "text/javascript" + }, + new () { + Name = "ETag", + Value = "\u0022compressed-gzip\u0022" + }, + new () { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () { + Name = "integrity", + Value = "sha256-compressed-gzip" + } + ] + } +}; + + endpoints.Should().BeEquivalentTo(expectedEndpoints); + } + [Fact] public void AppliesContentNegotiationRules_ToAllRelatedAssetEndpoints() { @@ -135,6 +848,7 @@ public void AppliesContentNegotiationRules_ToAllRelatedAssetEndpoints() "candidate.js", "All", "All", + "original-fingerprint", "original" ), CreateCandidate( @@ -144,6 +858,7 @@ public void AppliesContentNegotiationRules_ToAllRelatedAssetEndpoints() "candidate.js", "All", "All", + "compressed-fingerprint", "compressed", Path.Combine("wwwroot", "candidate.js"), "Content-Encoding", @@ -264,6 +979,7 @@ public void AppliesContentNegotiationRules_IgnoresAlreadyProcessedEndpoints() "candidate.js", "All", "All", + "original-fingerprint", "original" ), CreateCandidate( @@ -273,6 +989,7 @@ public void AppliesContentNegotiationRules_IgnoresAlreadyProcessedEndpoints() "candidate.js", "All", "All", + "compressed-fingerprint", "compressed", Path.Combine("wwwroot", "candidate.js"), "Content-Encoding", @@ -281,10 +998,11 @@ public void AppliesContentNegotiationRules_IgnoresAlreadyProcessedEndpoints() ], CandidateEndpoints = new StaticWebAssetEndpoint[] { - new() { - Route = "candidate.js", - AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), - ResponseHeaders = + new() + { + Route = "candidate.js", + AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), + ResponseHeaders = [ new () { Name = "Content-Encoding", Value = "gzip" }, new (){ Name = "Content-Type", Value = "text/javascript" }, @@ -293,20 +1011,22 @@ public void AppliesContentNegotiationRules_IgnoresAlreadyProcessedEndpoints() EndpointProperties = [], Selectors = [ new StaticWebAssetEndpointSelector { Name = "Content-Encoding", Value = "gzip", Quality = "0.100000000000" } ], }, - new() { - Route = "candidate.js", - AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), - ResponseHeaders = + new() + { + Route = "candidate.js", + AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), + ResponseHeaders = [ new (){ Name = "Content-Type", Value = "text/javascript" } ], EndpointProperties = [], Selectors = [], }, - new() { - Route = "candidate.fingerprint.js", - AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), - ResponseHeaders = + new() + { + Route = "candidate.fingerprint.js", + AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), + ResponseHeaders = [ new (){ Name = "Content-Encoding", Value = "gzip" }, new (){ Name = "Content-Type", Value = "text/javascript" }, @@ -315,20 +1035,22 @@ public void AppliesContentNegotiationRules_IgnoresAlreadyProcessedEndpoints() EndpointProperties = [], Selectors = [ new () { Name = "Content-Encoding", Value = "gzip", Quality = "0.100000000000" } ], }, - new() { - Route = "candidate.fingerprint.js", - AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), - ResponseHeaders = + new() + { + Route = "candidate.fingerprint.js", + AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), + ResponseHeaders = [ new () { Name = "Content-Type", Value = "text/javascript" } ], EndpointProperties = [], Selectors = [], }, - new() { - Route = "candidate.js.gz", - AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), - ResponseHeaders = + new() + { + Route = "candidate.js.gz", + AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), + ResponseHeaders = [ new () { Name = "Content-Encoding", Value = "gzip" }, new () { Name = "Content-Type", Value = "text/javascript" }, @@ -437,6 +1159,7 @@ public void AppliesContentNegotiationRules_ProcessesNewCompressedFormatsWhenAvai "candidate.js", "All", "All", + "original-fingerprint", "original" ), CreateCandidate( @@ -446,6 +1169,7 @@ public void AppliesContentNegotiationRules_ProcessesNewCompressedFormatsWhenAvai "candidate.js", "All", "All", + "compressed-gzip", "compressed", Path.Combine("wwwroot", "candidate.js"), "Content-Encoding", @@ -458,6 +1182,7 @@ public void AppliesContentNegotiationRules_ProcessesNewCompressedFormatsWhenAvai "candidate.js", "All", "All", + "compressed-brotli", "compressed", Path.Combine("wwwroot", "candidate.js"), "Content-Encoding", @@ -466,10 +1191,11 @@ public void AppliesContentNegotiationRules_ProcessesNewCompressedFormatsWhenAvai ], CandidateEndpoints = new StaticWebAssetEndpoint[] { - new() { - Route = "candidate.js", - AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), - ResponseHeaders = + new() + { + Route = "candidate.js", + AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), + ResponseHeaders = [ new () { Name = "Content-Encoding", Value = "gzip" }, new (){ Name = "Content-Type", Value = "text/javascript" }, @@ -478,20 +1204,22 @@ public void AppliesContentNegotiationRules_ProcessesNewCompressedFormatsWhenAvai EndpointProperties = [], Selectors = [ new StaticWebAssetEndpointSelector { Name = "Content-Encoding", Value = "gzip", Quality = "0.100000000000" } ], }, - new() { - Route = "candidate.js", - AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), - ResponseHeaders = + new() + { + Route = "candidate.js", + AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), + ResponseHeaders = [ new (){ Name = "Content-Type", Value = "text/javascript" } ], EndpointProperties = [], Selectors = [], }, - new() { - Route = "candidate.fingerprint.js", - AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), - ResponseHeaders = + new() + { + Route = "candidate.fingerprint.js", + AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), + ResponseHeaders = [ new (){ Name = "Content-Encoding", Value = "gzip" }, new (){ Name = "Content-Type", Value = "text/javascript" }, @@ -500,20 +1228,22 @@ public void AppliesContentNegotiationRules_ProcessesNewCompressedFormatsWhenAvai EndpointProperties = [], Selectors = [ new () { Name = "Content-Encoding", Value = "gzip", Quality = "0.100000000000" } ], }, - new() { - Route = "candidate.fingerprint.js", - AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), - ResponseHeaders = + new() + { + Route = "candidate.fingerprint.js", + AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), + ResponseHeaders = [ new () { Name = "Content-Type", Value = "text/javascript" } ], EndpointProperties = [], Selectors = [], }, - new() { - Route = "candidate.js.gz", - AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), - ResponseHeaders = + new() + { + Route = "candidate.js.gz", + AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), + ResponseHeaders = [ new () { Name = "Content-Encoding", Value = "gzip" }, new () { Name = "Content-Type", Value = "text/javascript" }, @@ -522,10 +1252,11 @@ public void AppliesContentNegotiationRules_ProcessesNewCompressedFormatsWhenAvai EndpointProperties = [], Selectors = [] }, - new() { - Route = "candidate.js.br", - AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")), - ResponseHeaders = + new() + { + Route = "candidate.js.br", + AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")), + ResponseHeaders = [ new () { Name = "Content-Type", Value = "text/javascript" }, ], @@ -659,7 +1390,7 @@ private StaticWebAssetEndpointSelector[] CreateContentEcondingSelector(string na new StaticWebAssetEndpointSelector { Name = name, - Value = value, + Value = value, Quality = "0.100000000000" } ]; @@ -671,7 +1402,7 @@ private StaticWebAssetEndpointResponseHeader[] CreateHeaders(string contentType, [ new StaticWebAssetEndpointResponseHeader { Name = "Content-Type", - Value = contentType + Value = contentType }, ..(AdditionalHeaders ?? []).Select(h => new StaticWebAssetEndpointResponseHeader { Name = h.name, Value = h.value }) ]; @@ -684,6 +1415,7 @@ private ITaskItem CreateCandidate( string relativePath, string assetKind, string assetMode, + string fingerprint = "", string integrity = "", string relatedAsset = "", string assetTraitName = "", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/DefineStaticWebAssetEndpointsTest.cs b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/DefineStaticWebAssetEndpointsTest.cs index d16fd7dcc968..c4916b25a8c8 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/DefineStaticWebAssetEndpointsTest.cs +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/DefineStaticWebAssetEndpointsTest.cs @@ -199,6 +199,126 @@ public void CanDefineFingerprintedEndpoints() ]); } + [Fact] + public void CanDefineFingerprintedEndpoints_WithEmbeddedFingerprint() + { + var errorMessages = new List(); + var buildEngine = new Mock(); + buildEngine.Setup(e => e.LogErrorEvent(It.IsAny())) + .Callback(args => errorMessages.Add(args.Message)); + + var lastWrite = new DateTime(1990, 11, 15, 0, 0, 0, 0, DateTimeKind.Utc); + + var task = new DefineStaticWebAssetEndpoints + { + BuildEngine = buildEngine.Object, + CandidateAssets = [CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate#[.{fingerprint=yolo}]?.js", "All", "All", fingerprint: "1234asdf", integrity: "asdf1234")], + ExistingEndpoints = [], + ContentTypeMappings = [CreateContentMapping("**/*.js", "text/javascript")], + TestLengthResolver = asset => asset.EndsWith("candidate.js") ? 10 : throw new InvalidOperationException(), + TestLastWriteResolver = asset => asset.EndsWith("candidate.js") ? lastWrite : throw new InvalidOperationException(), + }; + + // Act + var result = task.Execute(); + + // Assert + result.Should().Be(true); + var endpoints = StaticWebAssetEndpoint.FromItemGroup(task.Endpoints); + endpoints.Length.Should().Be(2); + var endpoint = endpoints[1]; + + endpoint.Route.Should().Be("candidate.yolo.js"); + endpoint.AssetFile.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); + endpoint.EndpointProperties.Should().BeEquivalentTo([ + new StaticWebAssetEndpointProperty + { + Name = "fingerprint", + Value = "yolo" + }, + new StaticWebAssetEndpointProperty + { + Name = "integrity", + Value = "sha256-asdf1234" + }, + new StaticWebAssetEndpointProperty + { + Name = "label", + Value = "candidate.js" + } + ]); + endpoint.ResponseHeaders.Should().BeEquivalentTo( + [ + new StaticWebAssetEndpointResponseHeader + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "Content-Length", + Value = "10" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "Content-Type", + Value = "text/javascript" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "ETag", + Value = "\"asdf1234\"" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "Last-Modified", + Value = "Thu, 15 Nov 1990 00:00:00 GMT" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + } + ]); + + var otherEndpoint = endpoints[0]; + otherEndpoint.Route.Should().Be("candidate.js"); + otherEndpoint.AssetFile.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); + otherEndpoint.ResponseHeaders.Should().BeEquivalentTo( + [ + new StaticWebAssetEndpointResponseHeader + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "Cache-Control", + Value = "no-cache" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "Content-Length", + Value = "10" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "Content-Type", + Value = "text/javascript" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "ETag", + Value = "\"asdf1234\"" + }, + new StaticWebAssetEndpointResponseHeader + { + Name = "Last-Modified", + Value = "Thu, 15 Nov 1990 00:00:00 GMT" + } + ]); + } + [Fact] public void DoesNotDefineNewEndpointsWhenAnExistingEndpointAlreadyExists() { diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ResolveCompressedAssetsTest.cs b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ResolveCompressedAssetsTest.cs index 11bf0bf70f1a..bd164de346d6 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ResolveCompressedAssetsTest.cs +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ResolveCompressedAssetsTest.cs @@ -113,6 +113,61 @@ public void ResolvesAssetsMatchingIncludePattern() task.AssetsToCompress[1].ItemSpec.Should().EndWith(".br"); } + [Fact] + public void ResolvesAssets_WithFingerprint_MatchingIncludePattern() + { + // Arrange + var errorMessages = new List(); + var buildEngine = new Mock(); + buildEngine.Setup(e => e.LogErrorEvent(It.IsAny())) + .Callback(args => errorMessages.Add(args.Message)); + + var asset = new StaticWebAsset() + { + Identity = ItemSpec, + OriginalItemSpec = OriginalItemSpec, + RelativePath = Path.GetFileNameWithoutExtension(ItemSpec)+"#[.{fingerprint}]" + Path.GetExtension(ItemSpec), + ContentRoot = Path.GetDirectoryName(ItemSpec), + SourceType = StaticWebAsset.SourceTypes.Discovered, + SourceId = "App", + AssetKind = StaticWebAsset.AssetKinds.All, + AssetMode = StaticWebAsset.AssetModes.All, + AssetRole = StaticWebAsset.AssetRoles.Primary, + Fingerprint = "v1", + Integrity = "abc" + }.ToTaskItem(); + + var task = new ResolveCompressedAssets() + { + OutputPath = OutputBasePath, + BuildEngine = buildEngine.Object, + CandidateAssets = new[] { asset }, + IncludePatterns = "**\\*.tmp", + Formats = "gzip;brotli", + }; + + // Act + var result = task.Execute(); + + // Assert + result.Should().BeTrue(); + task.AssetsToCompress.Should().HaveCount(2); + task.AssetsToCompress[0].ItemSpec.Should().EndWith(".gz"); + var relativePath = task.AssetsToCompress[0].GetMetadata("RelativePath"); + relativePath.Should().EndWith(".gz"); + relativePath = Path.GetFileNameWithoutExtension(relativePath); + relativePath.Should().EndWith(".tmp"); + relativePath = Path.GetFileNameWithoutExtension(relativePath); + relativePath.Should().EndWith("#[.{fingerprint=v1}]"); + task.AssetsToCompress[1].ItemSpec.Should().EndWith(".br"); + relativePath = task.AssetsToCompress[1].GetMetadata("RelativePath"); + relativePath.Should().EndWith(".br"); + relativePath = Path.GetFileNameWithoutExtension(relativePath); + relativePath.Should().EndWith(".tmp"); + relativePath = Path.GetFileNameWithoutExtension(relativePath); + relativePath.Should().EndWith("#[.{fingerprint=v1}]"); + } + [Fact] public void ExcludesAssetsMatchingExcludePattern() { diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_CorrectlyBundlesScopedCssFiles.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_CorrectlyBundlesScopedCssFiles.Build.staticwebassets.json index d417d6ef38d0..e212cf716a67 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_CorrectlyBundlesScopedCssFiles.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_CorrectlyBundlesScopedCssFiles.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1058,69 +1066,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1567,7 +1512,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1595,9 +1540,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -1673,7 +1626,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json index d417d6ef38d0..e212cf716a67 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1058,69 +1066,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1567,7 +1512,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1595,9 +1540,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -1673,7 +1626,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json index 7251d5c1745e..8bfcdde82a9f 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json @@ -1153,7 +1153,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1198,7 +1198,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1208,7 +1208,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1236,9 +1236,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1318,7 +1326,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1468,69 +1476,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1832,7 +1777,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", + "Route": "AppWithPackageAndP2PReference.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1877,7 +1822,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.br", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1887,7 +1832,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1915,9 +1860,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.br" } ] }, @@ -1997,7 +1950,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2147,69 +2100,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.br", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "br", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "br" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.br", @@ -2656,7 +2546,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2684,9 +2574,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -2762,7 +2660,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3009,7 +2907,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3054,7 +2952,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3064,7 +2962,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3092,9 +2990,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.br" } ] }, @@ -3170,7 +3076,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json index d417d6ef38d0..e212cf716a67 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1058,69 +1066,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1567,7 +1512,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1595,9 +1540,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -1673,7 +1626,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_IncorporatesInitializersFromClassLibraries.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_IncorporatesInitializersFromClassLibraries.Build.staticwebassets.json index 8952bc582269..b1f5cb8f91f4 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_IncorporatesInitializersFromClassLibraries.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_IncorporatesInitializersFromClassLibraries.Build.staticwebassets.json @@ -1006,7 +1006,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1051,7 +1051,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1061,7 +1061,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1089,9 +1089,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1171,7 +1179,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1421,69 +1429,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1967,7 +1912,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1995,9 +1940,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -2073,7 +2026,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_NoDependencies_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_NoDependencies_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json index d417d6ef38d0..e212cf716a67 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_NoDependencies_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_NoDependencies_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1058,69 +1066,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1567,7 +1512,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1595,9 +1540,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -1673,7 +1626,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_NoDependencies_GeneratesJsonManifestAndCopiesItToOutputFolder_NoDependencies.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_NoDependencies_GeneratesJsonManifestAndCopiesItToOutputFolder_NoDependencies.Build.staticwebassets.json index d417d6ef38d0..e212cf716a67 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_NoDependencies_GeneratesJsonManifestAndCopiesItToOutputFolder_NoDependencies.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_NoDependencies_GeneratesJsonManifestAndCopiesItToOutputFolder_NoDependencies.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1058,69 +1066,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1567,7 +1512,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1595,9 +1540,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -1673,7 +1626,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Build.staticwebassets.json index 83bd94589a8d..7f1a58529e10 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/BuildProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Build.staticwebassets.json @@ -701,7 +701,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -746,7 +746,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -756,7 +756,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -784,9 +784,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -866,7 +874,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1216,69 +1224,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_CreatesEndpointsForAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_CreatesEndpointsForAssets.Build.staticwebassets.json index 24397c2597fb..4704aa3a0a40 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_CreatesEndpointsForAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_CreatesEndpointsForAssets.Build.staticwebassets.json @@ -200,7 +200,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -228,9 +228,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -306,7 +314,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -408,7 +416,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -436,9 +444,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -514,7 +530,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json index 9164754e0054..6d6cea45277d 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json index f7da73d2ad6e..109d70f6bf4b 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json @@ -137,7 +137,7 @@ ], "Endpoints": [ { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", + "Route": "ComponentApp.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -182,7 +182,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.gz", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -192,7 +192,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -220,9 +220,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -298,7 +306,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -400,7 +408,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -428,9 +436,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -506,7 +522,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -553,7 +569,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", + "Route": "ComponentApp.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -598,7 +614,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.br", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -608,7 +624,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -636,9 +652,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.br" } ] }, @@ -714,7 +738,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -816,7 +840,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -844,9 +868,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.br" } ] }, @@ -922,7 +954,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DiscoversJsModulesBasedOnPatterns.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DiscoversJsModulesBasedOnPatterns.Build.staticwebassets.json index 7bd8832fd658..c202aba56249 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DiscoversJsModulesBasedOnPatterns.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DiscoversJsModulesBasedOnPatterns.Build.staticwebassets.json @@ -253,7 +253,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", + "Route": "ComponentApp.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -298,7 +298,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.gz", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -308,7 +308,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -336,9 +336,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -414,7 +422,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -516,7 +524,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -544,9 +552,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -622,7 +638,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DoesNotUpdateManifest_WhenHasNotChanged.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DoesNotUpdateManifest_WhenHasNotChanged.Build.staticwebassets.json index 9164754e0054..6d6cea45277d 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DoesNotUpdateManifest_WhenHasNotChanged.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_DoesNotUpdateManifest_WhenHasNotChanged.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_FingerprintsContent_WhenEnabled.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_FingerprintsContent_WhenEnabled.Build.staticwebassets.json index 3aa788c7aeea..6e87f32a82a5 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_FingerprintsContent_WhenEnabled.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_FingerprintsContent_WhenEnabled.Build.staticwebassets.json @@ -145,7 +145,7 @@ ], "Endpoints": [ { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", + "Route": "ComponentApp.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -190,7 +190,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.gz", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -200,7 +200,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -228,9 +228,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -306,7 +314,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -408,7 +416,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -436,9 +444,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -514,7 +530,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -616,7 +632,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -644,9 +660,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "css/fingerprint-site.css.gz" } ] }, @@ -722,7 +746,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json index 9164754e0054..6d6cea45277d 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange.Build.staticwebassets.json index 9164754e0054..6d6cea45277d 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange_Updated.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange_Updated.Build.staticwebassets.json index eeade93c4ff1..c7b4cfdbc6e0 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange_Updated.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange_Updated.Build.staticwebassets.json @@ -200,7 +200,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -228,9 +228,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -306,7 +314,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -408,7 +416,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -436,9 +444,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -514,7 +530,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Clean_RemovesManifestFrom_BuildAndIntermediateOutput.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Clean_RemovesManifestFrom_BuildAndIntermediateOutput.Build.staticwebassets.json index 9164754e0054..6d6cea45277d 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Clean_RemovesManifestFrom_BuildAndIntermediateOutput.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Clean_RemovesManifestFrom_BuildAndIntermediateOutput.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_AppendTargetFrameworkToOutputPathFalse_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_AppendTargetFrameworkToOutputPathFalse_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json index 4aa16a316a66..0d88df179900 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_AppendTargetFrameworkToOutputPathFalse_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_AppendTargetFrameworkToOutputPathFalse_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1058,69 +1066,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1567,7 +1512,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1595,9 +1540,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -1673,7 +1626,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_AppendTargetFrameworkToOutputPathFalse_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_AppendTargetFrameworkToOutputPathFalse_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json index 7b1e8487222a..69cb9ba1b874 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_AppendTargetFrameworkToOutputPathFalse_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_AppendTargetFrameworkToOutputPathFalse_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json @@ -1153,7 +1153,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1198,7 +1198,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1208,7 +1208,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1236,9 +1236,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1318,7 +1326,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1468,69 +1476,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1922,7 +1867,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", + "Route": "AppWithPackageAndP2PReference.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1967,7 +1912,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.br", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1977,7 +1922,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2005,9 +1950,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.br" } ] }, @@ -2087,7 +2040,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2237,69 +2190,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\publish\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.br", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "br", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "br" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\publish\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.br", @@ -2601,7 +2491,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.gz", + "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -2646,7 +2536,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.gz", + "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -2656,7 +2546,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2684,9 +2574,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -2762,7 +2660,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3091,7 +2989,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3136,7 +3034,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3146,7 +3044,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3174,9 +3072,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.br" } ] }, @@ -3252,7 +3158,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_DifferentBuildAndPublish_LibraryInitializers.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_DifferentBuildAndPublish_LibraryInitializers.Build.staticwebassets.json index cecdc6d1138e..d2b3f17a48a3 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_DifferentBuildAndPublish_LibraryInitializers.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_DifferentBuildAndPublish_LibraryInitializers.Build.staticwebassets.json @@ -964,7 +964,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1009,7 +1009,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1019,7 +1019,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1047,9 +1047,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1129,7 +1137,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1379,69 +1387,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1925,7 +1870,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1953,9 +1898,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -2031,7 +1984,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_DifferentBuildAndPublish_LibraryInitializers.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_DifferentBuildAndPublish_LibraryInitializers.Publish.staticwebassets.json index 9738494979de..a84f09abd627 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_DifferentBuildAndPublish_LibraryInitializers.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_DifferentBuildAndPublish_LibraryInitializers.Publish.staticwebassets.json @@ -1516,7 +1516,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1561,7 +1561,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1571,7 +1571,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1599,9 +1599,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1681,7 +1689,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1831,69 +1839,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -2195,7 +2140,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", + "Route": "AppWithPackageAndP2PReference.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -2240,7 +2185,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.br", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -2250,7 +2195,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2278,9 +2223,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.br" } ] }, @@ -2360,7 +2313,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2710,69 +2663,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.br", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "br", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "br" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.br", @@ -3256,7 +3146,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3284,9 +3174,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -3362,7 +3260,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3609,7 +3507,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3654,7 +3552,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3664,7 +3562,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3692,9 +3590,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.br" } ] }, @@ -3770,7 +3676,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json index d417d6ef38d0..e212cf716a67 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1058,69 +1066,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1567,7 +1512,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1595,9 +1540,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -1673,7 +1626,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json index 92f9f586adfe..8bfcdde82a9f 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json @@ -1153,7 +1153,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1198,7 +1198,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1208,7 +1208,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1236,9 +1236,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1318,7 +1326,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1468,69 +1476,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1832,7 +1777,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", + "Route": "AppWithPackageAndP2PReference.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1877,7 +1822,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.br", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1887,7 +1832,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1915,9 +1860,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.br" } ] }, @@ -1997,7 +1950,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2147,69 +2100,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.br", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "br", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "br" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.br", @@ -2656,7 +2546,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2684,9 +2574,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -2762,7 +2660,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3064,7 +2962,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3092,9 +2990,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.br" } ] }, @@ -3170,7 +3076,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_IncorporatesInitializersFromClassLibrariesAndPublishesAssetsToTheRightLocation.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_IncorporatesInitializersFromClassLibrariesAndPublishesAssetsToTheRightLocation.Build.staticwebassets.json index 108ace240558..f9fa21a66eff 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_IncorporatesInitializersFromClassLibrariesAndPublishesAssetsToTheRightLocation.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_IncorporatesInitializersFromClassLibrariesAndPublishesAssetsToTheRightLocation.Build.staticwebassets.json @@ -1006,7 +1006,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1051,7 +1051,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1061,7 +1061,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1089,9 +1089,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1171,7 +1179,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1421,69 +1429,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -2067,7 +2012,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2095,9 +2040,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -2173,7 +2126,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_IncorporatesInitializersFromClassLibrariesAndPublishesAssetsToTheRightLocation.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_IncorporatesInitializersFromClassLibrariesAndPublishesAssetsToTheRightLocation.Publish.staticwebassets.json index 682eff3cfcad..958728f08f27 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_IncorporatesInitializersFromClassLibrariesAndPublishesAssetsToTheRightLocation.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_IncorporatesInitializersFromClassLibrariesAndPublishesAssetsToTheRightLocation.Publish.staticwebassets.json @@ -1579,7 +1579,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1624,7 +1624,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1634,7 +1634,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1662,9 +1662,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1744,7 +1752,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1894,69 +1902,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -2258,7 +2203,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", + "Route": "AppWithPackageAndP2PReference.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -2303,7 +2248,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.br", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -2313,7 +2258,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2341,9 +2286,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.br" } ] }, @@ -2423,7 +2376,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2773,69 +2726,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.br", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "br", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "br" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.br", @@ -3419,7 +3309,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3447,9 +3337,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -3525,7 +3423,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3872,7 +3770,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3917,7 +3815,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3927,7 +3825,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3955,9 +3853,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.br" } ] }, @@ -4033,7 +3939,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json index d417d6ef38d0..e212cf716a67 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1058,69 +1066,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1567,7 +1512,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1595,9 +1540,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -1673,7 +1626,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json index fe92d7764ac1..8bfcdde82a9f 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json @@ -1153,7 +1153,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1198,7 +1198,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1208,7 +1208,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1236,9 +1236,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1318,7 +1326,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1468,69 +1476,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1832,7 +1777,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", + "Route": "AppWithPackageAndP2PReference.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1877,7 +1822,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.br", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1887,7 +1832,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1915,9 +1860,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.br" } ] }, @@ -1997,7 +1950,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2147,69 +2100,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.br", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "br", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "br" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.br", @@ -2601,7 +2491,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.gz", + "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -2646,7 +2536,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.gz", + "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -2656,7 +2546,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2684,9 +2574,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -2762,7 +2660,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3064,7 +2962,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3092,9 +2990,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.br" } ] }, @@ -3170,7 +3076,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json index 0d67cfdd01d4..1f8e72b8fb64 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1058,69 +1066,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1567,7 +1512,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1595,9 +1540,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -1673,7 +1626,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json index d21157017152..63b514c95502 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json @@ -1153,7 +1153,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1198,7 +1198,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1208,7 +1208,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1236,9 +1236,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1318,7 +1326,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1468,69 +1476,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -1832,7 +1777,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", + "Route": "AppWithPackageAndP2PReference.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1877,7 +1822,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.br", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\publish\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1887,7 +1832,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1915,9 +1860,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.br" } ] }, @@ -1997,7 +1950,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2147,69 +2100,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.br", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "br", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "br" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.br", @@ -2656,7 +2546,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2684,9 +2574,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.gz" } ] }, @@ -2762,7 +2660,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3009,7 +2907,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3054,7 +2952,7 @@ ] }, { - "Route": "_content/ClassLibrary/ClassLibrary.bundle.scp.css.br", + "Route": "_content/ClassLibrary/ClassLibrary.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\ClassLibrary\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ClassLibrary\\ClassLibrary#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -3064,7 +2962,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -3092,9 +2990,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ClassLibrary.bundle.scp.css.br" } ] }, @@ -3170,7 +3076,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Build.staticwebassets.json index 83bd94589a8d..7f1a58529e10 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Build.staticwebassets.json @@ -701,7 +701,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -746,7 +746,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -756,7 +756,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -784,9 +784,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -866,7 +874,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1216,69 +1224,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Publish.staticwebassets.json index 7fa0f3f79fed..a3a7fef80a64 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/PublishProjectWithReferences_WorksWithStaticWebAssetsV1ClassLibraries.Publish.staticwebassets.json @@ -890,7 +890,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -935,7 +935,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -945,7 +945,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -973,9 +973,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1055,7 +1063,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1405,69 +1413,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -2024,7 +1969,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2052,9 +1997,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.br" } ] }, @@ -2134,7 +2087,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2484,69 +2437,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.br", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "br", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "br" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.br", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets.Publish.staticwebassets.json index c289d7c795c0..598bdd181a9b 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets.Publish.staticwebassets.json @@ -208,7 +208,7 @@ ], "Endpoints": [ { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", + "Route": "ComponentApp.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -253,7 +253,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.gz", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -263,7 +263,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -291,9 +291,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -369,7 +377,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -416,7 +424,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.styles.css.gz", + "Route": "ComponentApp.styles.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -461,7 +469,7 @@ ] }, { - "Route": "ComponentApp.styles.css.gz", + "Route": "ComponentApp.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -471,7 +479,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -499,9 +507,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -577,7 +593,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -724,7 +740,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", + "Route": "ComponentApp.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -769,7 +785,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.br", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -779,7 +795,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -807,9 +823,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.br" } ] }, @@ -885,7 +909,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -932,7 +956,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.styles.css.br", + "Route": "ComponentApp.styles.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -977,7 +1001,7 @@ ] }, { - "Route": "ComponentApp.styles.css.br", + "Route": "ComponentApp.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -987,7 +1011,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1015,9 +1039,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.br" } ] }, @@ -1093,7 +1125,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets_BuildAndPublish_Assets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets_BuildAndPublish_Assets.Publish.staticwebassets.json index 105d9680ed0f..09bd5c139562 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets_BuildAndPublish_Assets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets_BuildAndPublish_Assets.Publish.staticwebassets.json @@ -263,7 +263,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -291,9 +291,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -369,7 +377,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -471,7 +479,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -499,9 +507,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -577,7 +593,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -779,7 +795,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -807,9 +823,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.br" } ] }, @@ -885,7 +909,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -932,7 +956,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.styles.css.br", + "Route": "ComponentApp.styles.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -977,7 +1001,7 @@ ] }, { - "Route": "ComponentApp.styles.css.br", + "Route": "ComponentApp.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -987,7 +1011,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1015,9 +1039,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.br" } ] }, @@ -1093,7 +1125,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json index 9164754e0054..6d6cea45277d 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json index f7da73d2ad6e..109d70f6bf4b 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json @@ -137,7 +137,7 @@ ], "Endpoints": [ { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", + "Route": "ComponentApp.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -182,7 +182,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.gz", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -192,7 +192,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -220,9 +220,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -298,7 +306,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -400,7 +408,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -428,9 +436,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -506,7 +522,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -553,7 +569,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", + "Route": "ComponentApp.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -598,7 +614,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.br", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -608,7 +624,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -636,9 +652,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.br" } ] }, @@ -714,7 +738,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -816,7 +840,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -844,9 +868,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.br" } ] }, @@ -922,7 +954,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json index 9164754e0054..6d6cea45277d 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json index f7da73d2ad6e..109d70f6bf4b 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json @@ -137,7 +137,7 @@ ], "Endpoints": [ { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", + "Route": "ComponentApp.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -182,7 +182,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.gz", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -192,7 +192,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -220,9 +220,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -298,7 +306,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -400,7 +408,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -428,9 +436,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -506,7 +522,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -553,7 +569,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", + "Route": "ComponentApp.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -598,7 +614,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.br", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -608,7 +624,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -636,9 +652,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.br" } ] }, @@ -714,7 +738,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -816,7 +840,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -844,9 +868,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.br" } ] }, @@ -922,7 +954,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json index e930120c3c5d..443ea8836b15 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json index dd65a941d2c5..618e5a3cf765 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json @@ -137,7 +137,7 @@ ], "Endpoints": [ { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", + "Route": "ComponentApp.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -182,7 +182,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.gz", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -192,7 +192,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -220,9 +220,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -298,7 +306,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -400,7 +408,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -428,9 +436,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -506,7 +522,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -553,7 +569,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", + "Route": "ComponentApp.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -598,7 +614,7 @@ ] }, { - "Route": "ComponentApp.bundle.scp.css.br", + "Route": "ComponentApp.__fingerprint__.bundle.scp.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\${Rid}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]!.bundle.scp.css.br", "Selectors": [], "ResponseHeaders": [ @@ -608,7 +624,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -636,9 +652,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.br" } ] }, @@ -714,7 +738,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -816,7 +840,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -844,9 +868,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.br" } ] }, @@ -922,7 +954,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishesJsModuleBundleBundleToTheRightLocation.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishesJsModuleBundleBundleToTheRightLocation.Publish.staticwebassets.json index 129849eb89c5..5bcba00ebd92 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishesJsModuleBundleBundleToTheRightLocation.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Publish_PublishesJsModuleBundleBundleToTheRightLocation.Publish.staticwebassets.json @@ -326,7 +326,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -354,9 +354,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -432,7 +440,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -479,7 +487,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.styles.css.gz", + "Route": "ComponentApp.styles.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -524,7 +532,7 @@ ] }, { - "Route": "ComponentApp.styles.css.gz", + "Route": "ComponentApp.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -534,7 +542,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -562,9 +570,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -640,7 +656,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -842,7 +858,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -870,9 +886,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.br" } ] }, @@ -948,7 +972,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -995,7 +1019,7 @@ ] }, { - "Route": "ComponentApp.__fingerprint__.styles.css.br", + "Route": "ComponentApp.styles.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1040,7 +1064,7 @@ ] }, { - "Route": "ComponentApp.styles.css.br", + "Route": "ComponentApp.__fingerprint__.styles.css.br", "AssetFile": "${ProjectPath}\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\ComponentApp\\ComponentApp#[.{fingerprint=__fingerprint__}]?.styles.css.br", "Selectors": [], "ResponseHeaders": [ @@ -1050,7 +1074,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1078,9 +1102,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.br" } ] }, @@ -1156,7 +1188,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json index 9164754e0054..6d6cea45277d 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder_Rebuild.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder_Rebuild.Build.staticwebassets.json index 9164754e0054..6d6cea45277d 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder_Rebuild.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder_Rebuild.Build.staticwebassets.json @@ -150,7 +150,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -178,9 +178,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.bundle.scp.css.gz" } ] }, @@ -256,7 +264,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -358,7 +366,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -386,9 +394,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "ComponentApp.styles.css.gz" } ] }, @@ -464,7 +480,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/ScopedCss_IsBackwardsCompatible_WithPreviousVersions.Build.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/ScopedCss_IsBackwardsCompatible_WithPreviousVersions.Build.staticwebassets.json index ecc374604ec8..462e6542b366 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/ScopedCss_IsBackwardsCompatible_WithPreviousVersions.Build.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/ScopedCss_IsBackwardsCompatible_WithPreviousVersions.Build.staticwebassets.json @@ -743,7 +743,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -788,7 +788,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -798,7 +798,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -826,9 +826,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -908,7 +916,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1358,69 +1366,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/ScopedCss_PublishIsBackwardsCompatible_WithPreviousVersions.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/ScopedCss_PublishIsBackwardsCompatible_WithPreviousVersions.Publish.staticwebassets.json index f94540703af1..886793de859c 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/ScopedCss_PublishIsBackwardsCompatible_WithPreviousVersions.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsBaselines/ScopedCss_PublishIsBackwardsCompatible_WithPreviousVersions.Publish.staticwebassets.json @@ -953,7 +953,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -998,7 +998,7 @@ ] }, { - "Route": "AppWithPackageAndP2PReference.styles.css.gz", + "Route": "AppWithPackageAndP2PReference.__fingerprint__.styles.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\AppWithPackageAndP2PReference\\AppWithPackageAndP2PReference#[.{fingerprint=__fingerprint__}]?.styles.css.gz", "Selectors": [], "ResponseHeaders": [ @@ -1008,7 +1008,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1036,9 +1036,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.gz" } ] }, @@ -1118,7 +1126,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -1568,69 +1576,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.gz", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "gzip", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "gzip" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.gz", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.gz", @@ -2187,7 +2132,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2215,9 +2160,17 @@ } ], "EndpointProperties": [ + { + "Name": "fingerprint", + "Value": "__fingerprint__" + }, { "Name": "integrity", "Value": "__integrity__" + }, + { + "Name": "label", + "Value": "AppWithPackageAndP2PReference.styles.css.br" } ] }, @@ -2297,7 +2250,7 @@ }, { "Name": "Cache-Control", - "Value": "no-cache" + "Value": "max-age=31536000, immutable" }, { "Name": "Content-Encoding", @@ -2747,69 +2700,6 @@ } ] }, - { - "Route": "_content/RazorPackageLibraryDirectDependency/RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css", - "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\RazorPackageLibraryDirectDependency.__fingerprint__.bundle.scp.css.br", - "Selectors": [ - { - "Name": "Content-Encoding", - "Value": "br", - "Quality": "__quality__" - } - ], - "ResponseHeaders": [ - { - "Name": "Accept-Ranges", - "Value": "bytes" - }, - { - "Name": "Cache-Control", - "Value": "no-cache" - }, - { - "Name": "Content-Encoding", - "Value": "br" - }, - { - "Name": "Content-Length", - "Value": "__content-length__" - }, - { - "Name": "Content-Type", - "Value": "text/css" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "ETag", - "Value": "__etag__" - }, - { - "Name": "Last-Modified", - "Value": "__last-modified__" - }, - { - "Name": "Vary", - "Value": "Content-Encoding" - } - ], - "EndpointProperties": [ - { - "Name": "fingerprint", - "Value": "__fingerprint__" - }, - { - "Name": "integrity", - "Value": "__integrity__" - }, - { - "Name": "label", - "Value": "RazorPackageLibraryDirectDependency.bundle.scp.css" - } - ] - }, { "Route": "_content/RazorPackageLibraryDirectDependency/css/site.css.br", "AssetFile": "${ProjectPath}\\AppWithPackageAndP2PReference\\obj\\Debug\\${Tfm}\\compressed\\publish\\_content\\RazorPackageLibraryDirectDependency\\css\\site.css.br", From 4ed38464df0aad73786e99f6f4324c46099d6b18 Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Mon, 10 Jun 2024 23:45:28 +0200 Subject: [PATCH 2/3] Fix test --- .../ApplyCompressionNegotiationTest.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs index d7beefe1afe5..5720b0c3bc03 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs @@ -158,6 +158,7 @@ public void AppliesContentNegotiationRules_ForExistingAssets_WithFingerprints() compressedAssets[1].SetMetadata(nameof(StaticWebAsset.Fingerprint), "brotli"); compressedAssets[1].SetMetadata(nameof(StaticWebAsset.Integrity), "compressed-brotli"); candidateAssets.AddRange(compressedAssets); + var expectedName = Path.GetFileNameWithoutExtension(compressedAssets[0].ItemSpec); var defineStaticAssetEndpointsTask = new DefineStaticWebAssetEndpoints { TestLengthResolver = value => value switch @@ -213,7 +214,7 @@ string candidate when candidate.EndsWith(".js") => 20, new() { Route = "candidate.fingerprint.js", - AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.br"), + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), Selectors = [ new () { @@ -290,7 +291,7 @@ string candidate when candidate.EndsWith(".js") => 20, new() { Route = "candidate.fingerprint.js", - AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.gz"), + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), Selectors = [ new () { @@ -421,7 +422,7 @@ string candidate when candidate.EndsWith(".js") => 20, new() { Route = "candidate.fingerprint.js.br", - AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.br"), + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), ResponseHeaders = [ new () { @@ -485,7 +486,7 @@ string candidate when candidate.EndsWith(".js") => 20, new() { Route = "candidate.fingerprint.js.gz", - AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.gz"), + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), ResponseHeaders = [ new () { @@ -549,7 +550,7 @@ string candidate when candidate.EndsWith(".js") => 20, new() { Route = "candidate.js", - AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.br"), + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), Selectors = [ new () { @@ -616,7 +617,7 @@ string candidate when candidate.EndsWith(".js") => 20, new() { Route = "candidate.js", - AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.gz"), + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), Selectors = [ new () { @@ -727,7 +728,7 @@ string candidate when candidate.EndsWith(".js") => 20, new() { Route = "candidate.js.br", - AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.br"), + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), ResponseHeaders = [ new () { @@ -781,7 +782,7 @@ string candidate when candidate.EndsWith(".js") => 20, new() { Route = "candidate.js.gz", - AssetFile = Path.Combine(AppContext.BaseDirectory, "fpqnkdkwzy.gz"), + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), ResponseHeaders = [ new () { Name = "Accept-Ranges", From 9975c20820335d114046cc87170aca42ce8e6dbc Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Tue, 11 Jun 2024 02:16:08 +0200 Subject: [PATCH 3/3] Fix test --- .../ApplyCompressionNegotiationTest.cs | 980 +++++++++--------- 1 file changed, 490 insertions(+), 490 deletions(-) diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs index 5720b0c3bc03..21df2de00d5c 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/ApplyCompressionNegotiationTest.cs @@ -288,120 +288,66 @@ string candidate when candidate.EndsWith(".js") => 20, } ] }, - new() - { - Route = "candidate.fingerprint.js", - AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), - Selectors = [ - new () - { - Name = "Content-Encoding", - Value = "gzip", - Quality = "0.100000000000" - } - ], - ResponseHeaders = [ - new () - { - Name = "Accept-Ranges", - Value = "bytes" - }, - new () - { - Name = "Cache-Control", - Value = "max-age=31536000, immutable" - }, - new () - { - Name = "Content-Encoding", - Value = "gzip" - }, - new () - { - Name = "Content-Length", - Value = "9" - }, - new () - { - Name = "Content-Type", - Value = "text/javascript" - }, - new () - { - Name = "ETag", - Value = "\u0022compressed-gzip\u0022" - }, - new () - { - Name = "ETag", - Value = "W/\u0022original\u0022" - }, - new () - { - Name = "Last-Modified", - Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) - }, - new () - { - Name = "Vary", - Value = "Content-Encoding" - } - ], - EndpointProperties = [ - new () - { - Name = "fingerprint", - Value = "fingerprint" - }, - new () - { - Name = "integrity", - Value = "sha256-original" - }, - new () + new() { - Name = "label", - Value = "candidate.js" - } - ] - }, - new() - { - Route = "candidate.fingerprint.js", - AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot\\candidate.js"), + Route = "candidate.fingerprint.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), + Selectors = [ + new () + { + Name = "Content-Encoding", + Value = "gzip", + Quality = "0.100000000000" + } + ], ResponseHeaders = [ - new () - { - Name = "Accept-Ranges", - Value = "bytes" - }, - new () - { - Name = "Cache-Control", - Value = "max-age=31536000, immutable" - }, - new () - { - Name = "Content-Length", - Value = "20" - }, - new () - { - Name = "Content-Type", - Value = "text/javascript" - }, - new () - { - Name = "ETag", - Value = "\u0022original\u0022" - }, - new () - { - Name = "Last-Modified", - Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) - } - ], - EndpointProperties = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + }, + new () + { + Name = "Content-Encoding", + Value = "gzip" + }, + new () + { + Name = "Content-Length", + Value = "9" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-gzip\u0022" + }, + new () + { + Name = "ETag", + Value = "W/\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ new () { Name = "fingerprint", @@ -417,413 +363,467 @@ string candidate when candidate.EndsWith(".js") => 20, Name = "label", Value = "candidate.js" } - ] - }, - new() - { - Route = "candidate.fingerprint.js.br", - AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), - ResponseHeaders = [ - new () + ] + }, + new() { + Route = "candidate.fingerprint.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot", "candidate.js"), + ResponseHeaders = [ + new () + { Name = "Accept-Ranges", Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + }, + new () + { + Name = "Content-Length", + Value = "20" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + } + ], + EndpointProperties = [ + new () + { + Name = "fingerprint", + Value = "fingerprint" + }, + new () + { + Name = "integrity", + Value = "sha256-original" + }, + new () + { + Name = "label", + Value = "candidate.js" + } + ] }, - new () + new() { - Name = "Cache-Control", - Value = "max-age=31536000, immutable" + Route = "candidate.fingerprint.js.br", + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + }, + new () + { + Name = "Content-Encoding", + Value = "br" + }, + new () + { + Name = "Content-Length", + Value = "7" + }, + new () + { + Name = "Content-Type", + Value = "application/octet-stream" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-brotli\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "fingerprint", + Value = "fingerprint" + }, + new () + { + Name = "integrity", + Value = "sha256-compressed-brotli" + }, + new () + { + Name = "label", + Value = "candidate.js.br" + } + ] }, - new () + new() { - Name = "Content-Encoding", - Value = "br" + Route = "candidate.fingerprint.js.gz", + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "max-age=31536000, immutable" + }, + new () + { + Name = "Content-Encoding", + Value = "gzip" + }, + new () + { + Name = "Content-Length", + Value = "9" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-gzip\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "fingerprint", + Value = "fingerprint" + }, + new () + { + Name = "integrity", + Value = "sha256-compressed-gzip" + }, + new () + { + Name = "label", + Value = "candidate.js.gz" + } + ] }, - new () - { - Name = "Content-Length", - Value = "7" - }, - new () - { - Name = "Content-Type", - Value = "application/octet-stream" - }, - new () - { - Name = "ETag", - Value = "\u0022compressed-brotli\u0022" - }, - new () - { - Name = "Last-Modified", - Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) - }, - new () - { - Name = "Vary", - Value = "Content-Encoding" - } - ], - EndpointProperties = [ - new () - { - Name = "fingerprint", - Value = "fingerprint" - }, - new () - { - Name = "integrity", - Value = "sha256-compressed-brotli" - }, - new () + new() { - Name = "label", - Value = "candidate.js.br" - } - ] - }, - new() - { - Route = "candidate.fingerprint.js.gz", - AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), + Route = "candidate.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), + Selectors = [ + new () + { + Name = "Content-Encoding", + Value = "br", + Quality = "0.125000000000" + } + ], ResponseHeaders = [ - new () - { - Name = "Accept-Ranges", - Value = "bytes" - }, - new () - { - Name = "Cache-Control", - Value = "max-age=31536000, immutable" - }, - new () - { - Name = "Content-Encoding", - Value = "gzip" - }, - new () - { - Name = "Content-Length", - Value = "9" - }, - new () - { - Name = "Content-Type", - Value = "text/javascript" - }, - new () - { - Name = "ETag", - Value = "\u0022compressed-gzip\u0022" - }, - new () - { - Name = "Last-Modified", - Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) - }, - new () - { - Name = "Vary", - Value = "Content-Encoding" - } - ], - EndpointProperties = [ - new () - { - Name = "fingerprint", - Value = "fingerprint" - }, - new () - { - Name = "integrity", - Value = "sha256-compressed-gzip" - }, - new () - { - Name = "label", - Value = "candidate.js.gz" - } - ] - }, - new() - { - Route = "candidate.js", - AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), - Selectors = [ - new () - { - Name = "Content-Encoding", - Value = "br", - Quality = "0.125000000000" - } - ], - ResponseHeaders = [ - new () - { - Name = "Accept-Ranges", - Value = "bytes" - }, - new () - { - Name = "Cache-Control", - Value = "no-cache" - }, - new () - { - Name = "Content-Encoding", - Value = "br" - }, - new () - { - Name = "Content-Length", - Value = "7" - }, - new () - { - Name = "Content-Type", - Value = "text/javascript" - }, - new () - { - Name = "ETag", - Value = "\u0022compressed-brotli\u0022" - }, - new () - { - Name = "ETag", - Value = "W/\u0022original\u0022" - }, - new () - { - Name = "Last-Modified", - Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) - }, - new () - { - Name = "Vary", - Value = "Content-Encoding" - } - ], - EndpointProperties = [ - new () - { - Name = "integrity", - Value = "sha256-original" - } - ] - }, - new() - { - Route = "candidate.js", - AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), - Selectors = [ - new () - { - Name = "Content-Encoding", - Value = "gzip", - Quality = "0.100000000000" - } - ], - ResponseHeaders = [ - new () - { - Name = "Accept-Ranges", - Value = "bytes" - }, - new () - { - Name = "Cache-Control", - Value = "no-cache" - }, - new () - { - Name = "Content-Encoding", - Value = "gzip" - }, - new () - { - Name = "Content-Length", - Value = "9" - }, - new () - { - Name = "Content-Type", - Value = "text/javascript" - }, - new () - { - Name = "ETag", - Value = "\u0022compressed-gzip\u0022" - }, - new () - { - Name = "ETag", - Value = "W/\u0022original\u0022" - }, - new () - { - Name = "Last-Modified", - Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "no-cache" + }, + new () + { + Name = "Content-Encoding", + Value = "br" + }, + new () + { + Name = "Content-Length", + Value = "7" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-brotli\u0022" + }, + new () + { + Name = "ETag", + Value = "W/\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "integrity", + Value = "sha256-original" + } + ] }, - new () - { - Name = "Vary", - Value = "Content-Encoding" - } - ], - EndpointProperties = [ - new () + new() { - Name = "integrity", - Value = "sha256-original" - } - ] - }, - new() - { - Route = "candidate.js", - AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot\\candidate.js"), + Route = "candidate.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), + Selectors = [ + new () + { + Name = "Content-Encoding", + Value = "gzip", + Quality = "0.100000000000" + } + ], ResponseHeaders = [ - new () - { - Name = "Accept-Ranges", - Value = "bytes" - }, - new () - { - Name = "Cache-Control", - Value = "no-cache" - }, - new () - { - Name = "Content-Length", - Value = "20" + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "no-cache" + }, + new () + { + Name = "Content-Encoding", + Value = "gzip" + }, + new () + { + Name = "Content-Length", + Value = "9" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-gzip\u0022" + }, + new () + { + Name = "ETag", + Value = "W/\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "integrity", + Value = "sha256-original" + } + ] }, - new () + new() { - Name = "Content-Type", - Value = "text/javascript" + Route = "candidate.js", + AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot", "candidate.js"), + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "no-cache" + }, + new () + { + Name = "Content-Length", + Value = "20" + }, + new () + { + Name = "Content-Type", + Value = "text/javascript" + }, + new () + { + Name = "ETag", + Value = "\u0022original\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + } + ], + EndpointProperties = [ + new () + { + Name = "integrity", + Value = "sha256-original" + } + ] }, - new () + new() { - Name = "ETag", - Value = "\u0022original\u0022" + Route = "candidate.js.br", + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), + ResponseHeaders = [ + new () + { + Name = "Accept-Ranges", + Value = "bytes" + }, + new () + { + Name = "Cache-Control", + Value = "no-cache" + }, + new () + { + Name = "Content-Encoding", + Value = "br" + }, + new () + { + Name = "Content-Length", + Value = "7" + }, + new () + { + Name = "Content-Type", + Value = "application/octet-stream" + }, + new () + { + Name = "ETag", + Value = "\u0022compressed-brotli\u0022" + }, + new () + { + Name = "Last-Modified", + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () + { + Name = "Vary", + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () + { + Name = "integrity", + Value = "sha256-compressed-brotli" + } + ] }, - new () - { - Name = "Last-Modified", - Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) - } - ], - EndpointProperties = [ - new () - { - Name = "integrity", - Value = "sha256-original" - } - ] - }, - new() - { - Route = "candidate.js.br", - AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), - ResponseHeaders = [ - new () + new() { + Route = "candidate.js.gz", + AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), + ResponseHeaders = [ + new () { Name = "Accept-Ranges", - Value = "bytes" - }, - new () - { + Value = "bytes" + }, + new () { Name = "Cache-Control", - Value = "no-cache" - }, - new () - { + Value = "no-cache" + }, + new () { Name = "Content-Encoding", - Value = "br" - }, - new () - { + Value = "gzip" + }, + new () { Name = "Content-Length", - Value = "7" - }, - new () - { + Value = "9" + }, + new () { Name = "Content-Type", - Value = "application/octet-stream" - }, - new () - { + Value = "text/javascript" + }, + new () { Name = "ETag", - Value = "\u0022compressed-brotli\u0022" - }, - new () - { + Value = "\u0022compressed-gzip\u0022" + }, + new () { Name = "Last-Modified", - Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) - }, - new () - { + Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) + }, + new () { Name = "Vary", - Value = "Content-Encoding" - } - ], - EndpointProperties = [ - new () - { + Value = "Content-Encoding" + } + ], + EndpointProperties = [ + new () { Name = "integrity", - Value = "sha256-compressed-brotli" - } - ] - }, - new() - { - Route = "candidate.js.gz", - AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), - ResponseHeaders = [ - new () { - Name = "Accept-Ranges", - Value = "bytes" - }, - new () { - Name = "Cache-Control", - Value = "no-cache" - }, - new () { - Name = "Content-Encoding", - Value = "gzip" - }, - new () { - Name = "Content-Length", - Value = "9" - }, - new () { - Name = "Content-Type", - Value = "text/javascript" - }, - new () { - Name = "ETag", - Value = "\u0022compressed-gzip\u0022" - }, - new () { - Name = "Last-Modified", - Value = now.ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture) - }, - new () { - Name = "Vary", - Value = "Content-Encoding" - } - ], - EndpointProperties = [ - new () { - Name = "integrity", - Value = "sha256-compressed-gzip" + Value = "sha256-compressed-gzip" + } + ] } - ] - } }; endpoints.Should().BeEquivalentTo(expectedEndpoints);