mirror of
https://github.com/rohitg00/skillkit.git
synced 2026-11-19 02:13:58 +00:00
Cuts Vercel hobby edge-request burn on both skillkit (Vite static) and skillkit-docs (Next.js fumadocs) projects. Site stays human-first AND agent-first — Firecrawl, Context7, Crawl4AI, OpenClaw, Hermes, ChatGPT-User, Claude-User, PerplexityBot explicitly allowed; training crawlers and SEO scrapers blocked. skillkit (Vite, docs/skillkit): - vercel.json: Cache-Control on assets (1d browser, 7d edge, 30d SWR; immutable for hashed /assets/*), HTML (5min browser, 1d edge, 7d SWR), and /api JSON - redirects with has user-agent: deflect known training+SEO bots to /robots.txt; negative lookahead on source prevents /robots.txt redirect loop - public/robots.txt: explicit allow + deny lists skillkit-docs (Next.js, docs/fumadocs): - next.config.mjs: headers() block for /_next/static (1y immutable), assets (1d/7d/30d), /docs/* and / (5min/1d/7d) - src/middleware.ts: UA-aware allow/deny pipeline; allowed agents pass through, blocked bots get 403 with cache header so Vercel edge serves the rejection cheaply - public/robots.txt: same allow/deny list as marketing site
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import { createMDX } from 'fumadocs-mdx/next';
|
|
|
|
const withMDX = createMDX();
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const config = {
|
|
reactStrictMode: true,
|
|
trailingSlash: false,
|
|
skipTrailingSlashRedirect: true,
|
|
assetPrefix: 'https://skillkit-docs.vercel.app',
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/:path*.(css|js|png|jpg|jpeg|svg|webp|woff2|woff|ttf|ico)',
|
|
headers: [
|
|
{ key: 'Cache-Control', value: 'public, max-age=86400, s-maxage=604800, stale-while-revalidate=2592000' },
|
|
],
|
|
},
|
|
{
|
|
source: '/_next/static/:path*',
|
|
headers: [
|
|
{ key: 'Cache-Control', value: 'public, max-age=31536000, immutable' },
|
|
],
|
|
},
|
|
{
|
|
source: '/docs/:path*',
|
|
headers: [
|
|
{ key: 'Cache-Control', value: 'public, max-age=300, s-maxage=86400, stale-while-revalidate=604800' },
|
|
],
|
|
},
|
|
{
|
|
source: '/',
|
|
headers: [
|
|
{ key: 'Cache-Control', value: 'public, max-age=300, s-maxage=86400, stale-while-revalidate=604800' },
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default withMDX(config);
|