-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnext.config.ts
More file actions
64 lines (62 loc) · 2.27 KB
/
Copy pathnext.config.ts
File metadata and controls
64 lines (62 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
allowedDevOrigins: ["127.0.0.1"],
poweredByHeader: false,
images: {
remotePatterns: [
{ protocol: "https", hostname: "**.primal.net" },
{ protocol: "https", hostname: "primal.b-cdn.net" },
{ protocol: "https", hostname: "nostr.build" },
{ protocol: "https", hostname: "**.nostr.build" },
{ protocol: "https", hostname: "**.nostur.com" },
{ protocol: "https", hostname: "**.nostr.band" },
{ protocol: "https", hostname: "void.cat" },
{ protocol: "https", hostname: "pbs.twimg.com" },
{ protocol: "https", hostname: "**.iris.to" },
{ protocol: "https", hostname: "**.nostr.wine" },
{ protocol: "https", hostname: "**.sovbit.host" },
{ protocol: "https", hostname: "**.satellite.earth" },
{ protocol: "https", hostname: "**.nostrcheck.me" },
{ protocol: "https", hostname: "**.blossom.band" },
],
},
async headers() {
return [
{
source: "/:path*",
headers: [
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{ key: "X-Frame-Options", value: "SAMEORIGIN" },
{
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=()",
},
],
},
];
},
cacheComponents: true,
cacheLife: {
// Stale-while-revalidate profile for Nostr-backed data: every request is
// served from cache instantly, and any request arriving more than 5
// minutes after the last regeneration triggers a background refresh
// ("revalidate on user load"). A poisoned/empty snapshot heals in
// minutes instead of the 24h the "days" profile allowed.
nostr: {
stale: 300,
revalidate: 300,
expire: 60 * 60 * 24 * 7,
},
// Short SWR profile for targeted single-project relay lookups
// (getNostrProjectByIdDirect). A hit is stable, but a transient not-found
// must heal fast — pinning null for the 5-minute `nostr` window would
// re-strand the thinly-propagated project the lookup exists to rescue.
nostrLookup: {
stale: 30,
revalidate: 30,
expire: 300,
},
},
};
export default nextConfig;