Skip to content

feat!: Enable cache busting - #4078

Merged
nielsenko merged 4 commits into
serverpod:mainfrom
nielsenko:cache-busting
Oct 24, 2025
Merged

nielsenko merged 4 commits into
serverpod:mainfrom
nielsenko:cache-busting

Conversation

@nielsenko

@nielsenko nielsenko commented Oct 23, 2025 •

Copy link
Copy Markdown
Collaborator

Adds optional cacheBustingConfig parameter to StaticRoute.directory() factory constructor:

  • Passes cacheBustingConfig through to the underlying StaticHandler.directory()
  • Changes constructor signature from positional optional parameter to named parameters for better API clarity

Fixes #3832

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

If you need help, consider asking for advice on the discussion board.

Breaking changes

StaticRoute constructors use optional named parameters now. Users passing cacheControlFactory as a positional parameter must update to named parameter syntax.

@coderabbitai

coderabbitai Bot commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nielsenko
nielsenko requested review from a team and SandPod October 23, 2025 13:39
@nielsenko

Copy link
Copy Markdown
Collaborator Author

I'm a bit on the fence if I should duplicate the tests from relic regarding cache busting.

@nielsenko nielsenko self-assigned this Oct 23, 2025
@nielsenko
nielsenko marked this pull request as ready for review October 23, 2025 14:14
@SandPod

SandPod commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

@nielsenko - Feels like we only need to validate the integration. We don't actually need to duplicate the tests since we are using an external library (to this project).

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Not sure if we should add a cache busting test? Perhaps it would be good to have a smoketest to ensure that it works as expected?

@nielsenko
nielsenko requested a review from SandPod October 24, 2025 08:44

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@nielsenko
nielsenko merged commit ada7d11 into serverpod:main Oct 24, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatic static file cache busting

2 participants