From 023ae599e0805ead174963fdd2dd4053e2255bd7 Mon Sep 17 00:00:00 2001 From: mortezaei Date: Fri, 15 May 2026 07:01:28 +0330 Subject: [PATCH] debug --- next.config.ts | 30 +++++++++ src/app/layout.tsx | 32 +++++++-- src/app/loading.tsx | 16 +++++ src/app/providers.tsx | 2 + src/components/dev/debug-toast.tsx | 104 ----------------------------- src/lib/http.ts | 48 +------------ src/lib/performance.ts | 27 ++++++++ 7 files changed, 104 insertions(+), 155 deletions(-) create mode 100644 src/app/loading.tsx delete mode 100644 src/components/dev/debug-toast.tsx create mode 100644 src/lib/performance.ts diff --git a/next.config.ts b/next.config.ts index 418d1d3..485fd4e 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,7 +2,13 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { output: 'standalone', + + // Compression + compress: true, + + // Image optimization images: { + formats: ['image/avif', 'image/webp'], remotePatterns: [ { protocol: "https", @@ -10,6 +16,30 @@ const nextConfig: NextConfig = { }, ], }, + + // Headers for caching and preload + async headers() { + return [ + { + source: '/:path*', + headers: [ + { + key: 'Cache-Control', + value: 'public, max-age=3600, stale-while-revalidate=86400', + }, + ], + }, + { + source: '/fonts/:path*', + headers: [ + { + key: 'Cache-Control', + value: 'public, max-age=31536000, immutable', + }, + ], + }, + ]; + }, }; export default nextConfig; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index ec92091..107dd78 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,15 +1,22 @@ import type { Metadata } from "next"; import { Amiri } from "next/font/google"; import localFont from "next/font/local"; -import DevClickToComponent from "@/components/dev/dev-click-to-component"; -import DebugToast from "@/components/dev/debug-toast"; +import dynamic from "next/dynamic"; import Providers from "./providers"; import "./globals.css"; +const DevClickToComponent = dynamic( + () => import("@/components/dev/dev-click-to-component"), + { ssr: false } +); + + const faminela = localFont({ src: "../../public/fonts/Faminela/Faminela.otf", variable: "--font-faminela-local", display: "swap", + preload: true, + fallback: ["Arial", "sans-serif"], }); const amiri = Amiri({ @@ -17,11 +24,19 @@ const amiri = Amiri({ subsets: ["arabic"], variable: "--font-amiri", display: "swap", + preload: true, + fallback: ["Arial", "sans-serif"], }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "ازدواج حبیب", + description: "سامانه ازدواج اسلامی حبیب", + viewport: { + width: "device-width", + initialScale: 1, + maximumScale: 1, + }, + themeColor: "#ffffff", }; export default function RootLayout({ @@ -32,11 +47,19 @@ export default function RootLayout({ return ( + +