feat(docs): update configuration and improve caching for documentation site

- Added Cloudflare and OpenNext configurations to .gitignore.
- Updated next.config.mjs to disable image optimization for better performance with CDN.
- Modified fetchJson function in github.ts to use 'force-cache' for improved data fetching efficiency.
- Updated multiple image assets for the documentation site.
This commit is contained in:
leookun
2026-08-28 00:41:13 +08:00
parent ed300cc92e
commit c711690f90
6 changed files with 13 additions and 2 deletions
+2 -1
View File
@@ -7,9 +7,10 @@ export type RepoStats = {
async function fetchJson(url: string): Promise<Record<string, unknown> | null> {
try {
// 构建期取一次并静态化;数据随每次部署更新,运行时无需 ISR 缓存设施
const res = await fetch(url, {
headers: { Accept: 'application/vnd.github+json' },
next: { revalidate: 3600 },
cache: 'force-cache',
});
if (!res.ok) return null;
return (await res.json()) as Record<string, unknown>;