epam / epam/statgpt-admin-frontend

[Perf Improvement] No Image Optimization Strategy (External CDN, SVG Inlining)

Open
#212 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

perf
Dominant language
TypeScript
Stars
18
Forks
0
Avg merge
15h 5m
Merged PRs (30d)
19

Description

  • Where: next.config.js and components using <img> or static images
  • Why: No explicit <Image> component usage or optimizations. CDN-hosted images (cdn.jsdelivr.net for fonts/icons) are not cached or preloaded. SVG loading via webpack (@svgr/webpack) is configured but may not be lazy-loaded per route.
  • Impact:
    • Fonts from cdn.jsdelivr.net are render-blocking (no font-display: swap visible).
    • Unoptimized images increase page weight and layout shift.
  • Confidence: Medium

Fix:

  1. Replace <img> with Next.js <Image> in components:
import Image from 'next/image';
<Image src="/path/to/image.png" alt="..." width={100} height={100} priority={false} />
  1. Preload critical fonts and add font-display: swap:
// next.config.js
async headers() {
  return [
    {
      source: '/(.*)',
      headers: [
        {
          key: 'Link',
          value: '</fonts.gstatic.com/css2?...>; rel=preload; as=style',
        },
      ],
    },
  ];
}
  1. Inline critical SVGs or use dynamic imports for heavy SVG files:
import { lazy } from 'react';
const HeavySVG = lazy(() => import('@/icons/HeavyIcon.svg'));

Validate:

  • Lighthouse "First Contentful Paint" and "Largest Contentful Paint" metrics.
  • Check Network tab for render-blocking resources.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with next.config.js and search components for , static images, CDN resources, and SVG imports configured through @svgr/webpack. Review the proposed Image, font-loading, and SVG strategies, then validate with Lighthouse First Contentful Paint and Largest Contentful Paint metrics and the Network tab; done means the identified resources are no longer unnecessarily unoptimized or render-blocking.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, react, typescript, webpack
Domain
frontend, performance, web-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.