Skip to content

Add build-time cache-busting to main CSS#193

Merged
mmcky merged 1 commit intomainfrom
css-cache-busting
Mar 27, 2026
Merged

Add build-time cache-busting to main CSS#193
mmcky merged 1 commit intomainfrom
css-cache-busting

Conversation

@mmcky
Copy link
Copy Markdown
Collaborator

@mmcky mmcky commented Mar 27, 2026

Summary

Appends the Jekyll build timestamp to the main CSS URL so browsers always fetch the latest stylesheet after a deployment, preventing stale CSS from being served.

Before:

<link href="/assets/main.css" rel="stylesheet">

After:

<link href="/assets/main.css?v={{ site.time | date: '%Y%m%d%H%M%S' }}" rel="stylesheet">

The query string changes on every build, so browsers treat it as a new resource and bypass their cache. No manual version bumping required.

🤖 Generated with Claude Code

Appends the Jekyll build timestamp to the CSS URL so browsers
always fetch fresh styles after a deployment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 27, 2026 04:58
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for grand-swan-ca5201 ready!

Name Link
🔨 Latest commit d4a9580
🔍 Latest deploy log https://app.netlify.com/projects/grand-swan-ca5201/deploys/69c60e6b4076a40008cac788
😎 Deploy Preview https://deploy-preview-193--grand-swan-ca5201.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mmcky mmcky merged commit bdc81f2 into main Mar 27, 2026
5 checks passed
@mmcky mmcky deleted the css-cache-busting branch March 27, 2026 05:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds build-time cache busting for the site’s primary stylesheet so browsers fetch the latest main.css after each deployment, reducing the chance of stale CSS being served.

Changes:

  • Append a build timestamp (site.time) query parameter to /assets/main.css in the default layout.

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