Skip to content

Serve assets through a Worker with AVIF resizing - #14

Merged
MagicTheDev merged 16 commits into
mainfrom
feat/assets-image-worker
Sep 6, 2026
Merged

MagicTheDev merged 16 commits into
mainfrom
feat/assets-image-worker

Conversation

@MagicTheDev

@MagicTheDev MagicTheDev commented Sep 6, 2026 •

Copy link
Copy Markdown
Member

Assets were served directly from R2, so clients always received the stored file. This adds a Worker on assets.clashk.ing that keeps every existing URL working and can return resized AVIF images when requested.

The release process now publishes a hashed manifest, uploads split translation files, and clears only the changed asset cache entries. Generated still WebP files are also normalized so they are not stored as animations.

The Worker is live on the production hostname using the existing clashking-assets bucket. Its purge token stays in Cloudflare and GitHub secrets.

Checks

  • 71 Python tests pass.
  • 20 Worker tests pass.
  • TypeScript checking and the Wrangler deployment dry run pass.
  • The generated manifest and image-source layout are current.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-06T07:22:08.510460Z 6ba48af New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38e2123310

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/release-assets.yml
@MagicTheDev

Copy link
Copy Markdown
Member Author

@codex review
The duplicate workflow key is fixed, and animated WebP/APNG/AVIF-sequence conversion now falls back to original files. Please review the latest head.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f2162d17d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread worker/src/assets.ts
Comment thread check_image_sources.py Outdated
@MagicTheDev MagicTheDev changed the title Add R2-backed assets image Worker and sized AVIF delivery Serve assets through a Worker with AVIF resizing Sep 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53fadebabe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread generate_manifest.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe4afad90d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread worker/README.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7fdf98bdf5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread assets/viewer.js Outdated
@MagicTheDev
MagicTheDev merged commit 20f4347 into main Sep 6, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

url: new URL(entry.path.split("/").map(encodeURIComponent).join("/"), manifestUrl).href,

P2 Badge Resolve relative manifest overrides against the page

When the override is a same-origin relative URL such as ?manifest=/staging/manifest.json, fetch(source) succeeds but new URL(entry.path, manifestUrl) throws because its base is not absolute, so the viewer fails instead of rendering the overridden catalog. Fresh evidence after the prior override fix is this absolute-base requirement introduced by the new URL construction; resolve manifestUrl against window.location.href before using it as the asset base.


- 'worker/**'
- 'build.py'
- 'worker_purge.py'
- 'check_image_sources.py'
- 'tests/**'

P2 Badge Trigger checks for generator source changes

A PR that changes only generate_manifest.py or update_static.py skips this workflow because neither file matches the path filter, even though the job is meant to validate manifest generation and this change adds translation-generation behavior. Such regressions can therefore merge without running the relevant Python checks; include these generator inputs in the workflow paths.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant