Compare commits

..
3 Commits
Author SHA1 Message Date
deytenit 24f3311006 fix(www): enable font content hashing and automated preloads (#68)
🤖 **Summary:**
- **Root cause:** Font static assets were configured with unhashed
filenames (`[name][ext]`) while served with `Cache-Control: immutable,
max-age=31536000`. This caused Cloudflare edge nodes and client browsers
to permanently cache the older Latin-only font files from Sept 2026
under `https://www.ermnvldmr.com/ru/static/font/lato-400.woff2`,
ignoring the updated Cyrillic glyphs.
- **Changes:**
- Removed explicit `filename: { font: '[name][ext]' }` in
`packages/rsbuild-config/src/lib/config/rsbuild.ts` to enable Rsbuild's
default content-hashed font filenames (`[name].[contenthash:8][ext]`).
- Updated `services/www/rsbuild.config.ts` to remove hardcoded unhashed
font preload tags and configure Rsbuild's `performance.preload` to
automatically discover and emit hashed font `<link rel="preload"
as="font" crossorigin>` tags.
2026-10-25 21:15:04 +03:00
adam-at-deytenit 9a175925b6 chore(release): deploy www sha-b3638f4 [skip ci] 2026-10-25 12:27:46 +00:00
adam-at-deytenit 716cc5f6f1 chore(release): deploy docs sha-b3638f4 [skip ci] 2026-10-25 12:22:10 +00:00
4 changed files with 8 additions and 40 deletions

No files matched your search

+1 -1
View File
@@ -6,4 +6,4 @@ resources:
- service.yaml
images:
- name: ghcr.io/deytenit/ermnvldmr.com/docs
newTag: sha-fcf6895
newTag: sha-b3638f4
+1 -1
View File
@@ -6,4 +6,4 @@ resources:
- service.yaml
images:
- name: ghcr.io/deytenit/ermnvldmr.com/www
newTag: sha-968f41d
newTag: sha-b3638f4
@@ -26,9 +26,6 @@ export function defineServiceConfig(config: RsbuildConfig = {}): RsbuildConfig {
distPath: {
font: 'static/font',
},
filename: {
font: '[name][ext]',
},
},
html: {
template: './src/static/index.html',
+6 -35
View File
@@ -34,8 +34,6 @@ const MIME: Record<string, string> = {
};
const UMAMI_WWW_WEBSITE_ID = '4fca5ac2-4fe4-4626-b708-933c37bfe918';
const locale = process.env.LOCALE ?? 'en';
const fontBase = `/${locale}/static/font`;
export default defineSSGServiceConfig(
mergeConfig(localeRsbuildConfig(), {
@@ -99,44 +97,17 @@ export default defineSSGServiceConfig(
entry: discoverEntries(import.meta.dirname, './src/app/**/*.tsx'),
preEntry: ['./src/static/global.css'],
},
performance: {
preload: {
type: 'all-assets',
include: [/(lato-400|lato-700|eb-garamond-var)\..*\.woff2$/],
},
},
html: {
tags: [
{ tag: 'script', children: TRUSTED_TYPES_INIT_SCRIPT, head: true },
{ tag: 'script', children: THEME_INIT_SCRIPT, head: true },
{ tag: 'style', children: THEME_INIT_STYLES, head: true },
{
tag: 'link',
attrs: {
rel: 'preload',
as: 'font',
type: 'font/woff2',
href: `${fontBase}/lato-400.woff2`,
crossorigin: true,
},
publicPath: false,
},
{
tag: 'link',
attrs: {
rel: 'preload',
as: 'font',
type: 'font/woff2',
href: `${fontBase}/lato-700.woff2`,
crossorigin: true,
},
publicPath: false,
},
{
tag: 'link',
attrs: {
rel: 'preload',
as: 'font',
type: 'font/woff2',
href: `${fontBase}/eb-garamond-var.woff2`,
crossorigin: true,
},
publicPath: false,
},
],
},
})