next.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /** @type {import('next').NextConfig} */
  2. const nextConfig = {
  3. poweredByHeader: false,
  4. experimental: {
  5. // Ship the (small) stylesheet inline so first paint never waits on a CSS request.
  6. inlineCss: true,
  7. },
  8. images: {
  9. formats: ["image/avif", "image/webp"],
  10. minimumCacheTTL: 60 * 60 * 24 * 7,
  11. remotePatterns: [
  12. {
  13. protocol: "https",
  14. hostname: "firebasestorage.googleapis.com",
  15. },
  16. {
  17. protocol: "https",
  18. hostname: "www.notion.so",
  19. },
  20. // Blog covers linked straight from their source (see coverImageUrl).
  21. {
  22. protocol: "https",
  23. hostname: "upload.wikimedia.org",
  24. },
  25. {
  26. protocol: "https",
  27. hostname: "images.unsplash.com",
  28. },
  29. ],
  30. },
  31. async headers() {
  32. const cached = [
  33. {
  34. key: "Cache-Control",
  35. value: "public, max-age=86400, stale-while-revalidate=604800",
  36. },
  37. ];
  38. return [
  39. { source: "/data/:path*", headers: cached },
  40. { source: "/emoji/:path*", headers: cached },
  41. { source: "/mini.:ext", headers: cached },
  42. ];
  43. },
  44. };
  45. module.exports = nextConfig;