epam / epam/statgpt-admin-frontend
[Perf Improvement] No Image Optimization Strategy (External CDN, SVG Inlining)
Open
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.jsand components using<img>or static images - Why: No explicit
<Image>component usage or optimizations. CDN-hosted images (cdn.jsdelivr.netfor 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.netare render-blocking (nofont-display: swapvisible). - Unoptimized images increase page weight and layout shift.
- Fonts from
- Confidence: Medium
Fix:
- 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} />
- 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',
},
],
},
];
}
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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