Skip to content

use content-hashed static assets#91

Merged
andymeierdev merged 1 commit intomainfrom
andymeierdev/content-hashed-assets
Apr 15, 2026
Merged

use content-hashed static assets#91
andymeierdev merged 1 commit intomainfrom
andymeierdev/content-hashed-assets

Conversation

@andymeierdev
Copy link
Copy Markdown
Collaborator

Summary

  • replace runtime query-string cache busting with manifest-based asset lookup in the app
  • fingerprint published static assets with content hashes and emit asset-manifest.json
  • add tests for manifest resolution and keep the existing GA consent rendering coverage

Verification

  • cd app && ./fake.sh Test
  • cd app && ./fake.sh Publish

@github-actions
Copy link
Copy Markdown

🍹 preview on andymeier/prod

Pulumi report

View in Pulumi Cloud

  Previewing update (prod)

View Live: https://app.pulumi.com/meiermade/andymeier/prod/previews/5fbc19e2-fe49-440f-a7e8-05860fcf1330

pulumi:pulumi:Stack: (same)
  [urn=urn:pulumi:prod::andymeier::pulumi:pulumi:Stack::andymeier-prod]
  ~ docker-build:index:Image: (update)
      [id=sha256:ce2a92a5ac3610bf75a8e4d0bd3af7000f4199af0b2612252179582b79ae116c]
      [urn=urn:pulumi:prod::andymeier::docker-build:index:Image::andymeier]
    - contextHash: "277bcb441b05ec423ead15da5007e4e9d6ee9d8e41fe9c60fa86d4ffb0cebcef"
  ~ kubernetes:apps/v1:Deployment: (update)
      [id=andymeier/app]
      [urn=urn:pulumi:prod::andymeier::kubernetes:apps/v1:Deployment::app]
    ~ spec: {
        ~ template: {
            ~ spec: {
                ~ containers: [
                    ~ [0]: {
                            ~ image: "us-east1-docker.pkg.dev/meiermade-platform/platform/andymeier:latest@sha256:a98b8cd1c1da1abd89864b1a1c4c975aa1c606059b41d64698062095dcb6a033" => [unknown]
                          }
                  ]
              }
          }
      }
Resources:
  ~ 2 to update
  14 unchanged
  

@andymeierdev andymeierdev merged commit a01ecbc into main Apr 15, 2026
2 checks passed
@andymeierdev andymeierdev deleted the andymeierdev/content-hashed-assets branch April 15, 2026 15:44
Copy link
Copy Markdown

@minniemeierdev minniemeierdev left a comment

Choose a reason for hiding this comment

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

The code works well and successfully hashes the assets. However, dotnet publish automatically generates pre-compressed .br and .gz files for these assets in wwwroot. Your FAKE script copies the hashed assets but leaves the pre-compressed versions behind, meaning the server won't serve the compressed assets when requested by the fingerprinted name.

Please update the fingerprintAssets function in Build/Program.fs to copy the .br and .gz files alongside the hashed file, for example:

let fingerprintedPath = fingerprintedFilePath path hash
File.Copy(path, fingerprintedPath, true)
if File.Exists(path + ".br") then File.Copy(path + ".br", fingerprintedPath + ".br", true)
if File.Exists(path + ".gz") then File.Copy(path + ".gz", fingerprintedPath + ".gz", true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants