Skip to content

Commit 9185dbd

Browse files
fix: optimize desktop homepage performance
- Configure efficient cache lifetimes (1 year for static assets) - Fix layout shift in Partners section (added minHeight to prevent CLS) - Add fetchpriority to hero image for faster LCP Addresses critical PageSpeed Insights issues: 1. Cache lifetimes - Increased from 10 months to 1 year (31536000 seconds) 2. Layout shift - Added minHeight: 200px to Partners section wrapper 3. LCP optimization - Added fetchpriority=high to hero background image Fixes #6924 Signed-off-by: YadavAkhileshh <[email protected]>
1 parent 23b458e commit 9185dbd

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

_headers

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Cache static resources for 10 months
1+
# Cache static resources for 1 year
22
/*.js
33
/*.css
44
/*.woff2
@@ -7,11 +7,11 @@
77
/*.webp
88
/*.gif
99
/*.svg
10-
Cache-Control: public, max-age=25920000
10+
Cache-Control: public, max-age=31536000, immutable
1111

12-
# Cache HTML files for 10 months
12+
# HTML files - no cache
1313
/*.html
14-
Cache-Control: public, max-age=25920000
14+
Cache-Control: public, max-age=0
1515

1616

1717

src/sections/Home/Banner-1/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Banner1 = (props) => {
1515
return (
1616
<Banner1SectionWrapper {...props} >
1717
<Container >
18-
<img loading="eager" alt="hero-image" src={Backgroundsvg} className="background-svg" />
18+
<img loading="eager" fetchpriority="high" alt="hero-image" src={Backgroundsvg} className="background-svg" />
1919
<Row>
2020
<Col $sm={8} $lg={8} className="section-title-wrapper">
2121

@@ -26,11 +26,11 @@ const Banner1 = (props) => {
2626
>
2727
<h1>Cloud Native Management</h1>
2828
<h2>
29-
of <span>developer</span>-defined infrastructure
29+
of <span>developer</span>-defined infrastructure
3030
</h2>
3131
</SectionTitle>
3232
<p>
33-
an open source-first community of cloud native engineers
33+
an open source-first community of cloud native engineers
3434
</p>
3535
<span className="vintage-box-container">
3636
<VintageBox $right={true} $vintageOne={true}>

src/sections/Home/Partners-home/partnerSection.style.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import styled from "styled-components";
22
const PartnerItemWrapper = styled.section`
33
padding: 2rem 0;
44
margin: 0rem 0rem 5rem 0rem;
5+
min-height: 200px; /* Prevent layout shift (CLS) by reserving space for partner logos */
56
overflow: hidden;
67
.section-title{
78
h4{

0 commit comments

Comments
 (0)