Skip to content

Commit 62d84a8

Browse files
committed
AVIF for the two pictures every visitor fetches
The banner on the home page is that page's largest contentful paint -- literally the thing Google times the page by -- and at 1280 wide it was 99.5 KB. The logo lockup is in the header of every page. Both now have an AVIF beside them, offered first through <picture>; a browser that cannot read it skips the source and takes the WebP underneath, which is the file it gets today. hero 1280w 99.5 KB -> 58.0 KB 42% smaller hero 800w 44.3 KB -> 26.0 KB 41% smaller logo 400w 27.2 KB -> 17.4 KB 36% smaller logo 240w 16.8 KB -> 10.1 KB 40% smaller Smaller is easy; smaller without looking worse is the part worth checking. Decoded against the original and compared pixel by pixel, mean absolute error per channel, alpha composited rather than discarded: hero 1280w 2.50 -> 2.51 the same picture, at 58% of the weight hero 800w 3.18 -> 2.93 closer to the original than the WebP is logo 400w 2.28 -> 1.31 closer logo 240w 3.42 -> 1.68 closer The logo gains most because flat colour and hard edges are what AVIF is best at and what WebP handles worst. Its transparency survives the encode and the dimensions match exactly, which is the thing to confirm before believing any of the above -- an opaque AVIF would have put a black box in the header of every page. scripts/image-variants.mjs writes them, from the same widths the markup asks for, and runs first in build and dev. It writes nothing when the copies are already newer than their source, so a publish that changes no picture produces no diff. Like fetch-content.mjs it never fails the build: sharp is a native dependency, and a machine that cannot install it still publishes the site from what is committed, and says so. The WebP files are left exactly as they are. The first version of this regenerated them too, at a lower quality, which is a generation of loss for nothing -- the gain here is the format, not the quality dial. <picture> wraps the img with display:contents, so it is a wrapper for the browser's choosing rather than a box in the layout. The hero img is absolutely positioned and an inline <picture> around it would still generate a line box inside the band. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0128YzbhrfGdegUSc9RrARRf
1 parent 39a74fe commit 62d84a8

86 files changed

Lines changed: 1038 additions & 256 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.site-manifest.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@
1818
"index.html",
1919
"maruti-brezza-self-drive-car-rental-nagercoil.avif",
2020
"monthly",
21+
"mountain-road-at-sunrise-self-drive-car-rental-1280w.avif",
2122
"mountain-road-at-sunrise-self-drive-car-rental-1280w.webp",
23+
"mountain-road-at-sunrise-self-drive-car-rental-800w.avif",
2224
"mountain-road-at-sunrise-self-drive-car-rental-800w.webp",
25+
"mountain-road-at-sunrise-self-drive-car-rental.avif",
2326
"mountain-road-at-sunrise-self-drive-car-rental.webp",
2427
"nitesha-cars-and-bikes-emblem.webp",
28+
"nitesha-cars-and-bikes-logo-nagercoil-v2-240w.avif",
2529
"nitesha-cars-and-bikes-logo-nagercoil-v2-240w.webp",
30+
"nitesha-cars-and-bikes-logo-nagercoil-v2-400w.avif",
2631
"nitesha-cars-and-bikes-logo-nagercoil-v2-400w.webp",
32+
"nitesha-cars-and-bikes-logo-nagercoil-v2-800w.avif",
2733
"nitesha-cars-and-bikes-logo-nagercoil-v2-800w.webp",
34+
"nitesha-cars-and-bikes-logo-nagercoil-v2.avif",
2835
"nitesha-cars-and-bikes-logo-nagercoil-v2.webp",
2936
"nri",
3037
"photos",

‎.vite/manifest.json‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"file": "assets/SectionArt-CRGDPXOj.js",
1111
"name": "SectionArt"
1212
},
13-
"_ServicePage-CUlAmDzQ.js": {
14-
"file": "assets/ServicePage-CUlAmDzQ.js",
13+
"_ServicePage-Bh0tG8oR.js": {
14+
"file": "assets/ServicePage-Bh0tG8oR.js",
1515
"name": "ServicePage",
1616
"imports": [
1717
"_SectionArt-CRGDPXOj.js",
@@ -20,7 +20,7 @@
2020
]
2121
},
2222
"index.html": {
23-
"file": "assets/index-BF7vtdGq.js",
23+
"file": "assets/index-BLvM1V5H.js",
2424
"name": "index",
2525
"src": "index.html",
2626
"isEntry": true,
@@ -52,7 +52,7 @@
5252
]
5353
},
5454
"src/pages/About.tsx": {
55-
"file": "assets/About-BzCVrfp8.js",
55+
"file": "assets/About-CQstl_Tc.js",
5656
"name": "About",
5757
"src": "src/pages/About.tsx",
5858
"isDynamicEntry": true,
@@ -63,17 +63,17 @@
6363
]
6464
},
6565
"src/pages/Bikes.tsx": {
66-
"file": "assets/Bikes-Dv_LRU5Z.js",
66+
"file": "assets/Bikes-DeiEEcyN.js",
6767
"name": "Bikes",
6868
"src": "src/pages/Bikes.tsx",
6969
"isDynamicEntry": true,
7070
"imports": [
7171
"_SectionArt-CRGDPXOj.js",
72-
"_ServicePage-CUlAmDzQ.js"
72+
"_ServicePage-Bh0tG8oR.js"
7373
]
7474
},
7575
"src/pages/Blog.tsx": {
76-
"file": "assets/Blog-DpOLuxrk.js",
76+
"file": "assets/Blog-BAQSnyr1.js",
7777
"name": "Blog",
7878
"src": "src/pages/Blog.tsx",
7979
"isDynamicEntry": true,
@@ -84,7 +84,7 @@
8484
]
8585
},
8686
"src/pages/CarModel.tsx": {
87-
"file": "assets/CarModel-3mwn1wxI.js",
87+
"file": "assets/CarModel-BL9WUA5Z.js",
8888
"name": "CarModel",
8989
"src": "src/pages/CarModel.tsx",
9090
"isDynamicEntry": true,
@@ -96,7 +96,7 @@
9696
]
9797
},
9898
"src/pages/CarRentalAreas.tsx": {
99-
"file": "assets/CarRentalAreas-8L23kj3P.js",
99+
"file": "assets/CarRentalAreas-CcmydeDQ.js",
100100
"name": "CarRentalAreas",
101101
"src": "src/pages/CarRentalAreas.tsx",
102102
"isDynamicEntry": true,
@@ -107,7 +107,7 @@
107107
]
108108
},
109109
"src/pages/Cars.tsx": {
110-
"file": "assets/Cars-BbO9qmad.js",
110+
"file": "assets/Cars-D_N4tPjK.js",
111111
"name": "Cars",
112112
"src": "src/pages/Cars.tsx",
113113
"isDynamicEntry": true,
@@ -118,7 +118,7 @@
118118
]
119119
},
120120
"src/pages/Contact.tsx": {
121-
"file": "assets/Contact-c237v9Oz.js",
121+
"file": "assets/Contact-6WhVYujm.js",
122122
"name": "Contact",
123123
"src": "src/pages/Contact.tsx",
124124
"isDynamicEntry": true,
@@ -129,7 +129,7 @@
129129
]
130130
},
131131
"src/pages/Monthly.tsx": {
132-
"file": "assets/Monthly-ByOScUoW.js",
132+
"file": "assets/Monthly-DzBSMT1X.js",
133133
"name": "Monthly",
134134
"src": "src/pages/Monthly.tsx",
135135
"isDynamicEntry": true,
@@ -150,7 +150,7 @@
150150
]
151151
},
152152
"src/pages/Nri.tsx": {
153-
"file": "assets/Nri-B2gCQxC8.js",
153+
"file": "assets/Nri-DJfCysJe.js",
154154
"name": "Nri",
155155
"src": "src/pages/Nri.tsx",
156156
"isDynamicEntry": true,
@@ -161,7 +161,7 @@
161161
]
162162
},
163163
"src/pages/Places.tsx": {
164-
"file": "assets/Places-C_QQisZd.js",
164+
"file": "assets/Places-BbeoYCoi.js",
165165
"name": "Places",
166166
"src": "src/pages/Places.tsx",
167167
"isDynamicEntry": true,
@@ -172,7 +172,7 @@
172172
]
173173
},
174174
"src/pages/Post.tsx": {
175-
"file": "assets/Post-B1ssAaSI.js",
175+
"file": "assets/Post-DyElzbI7.js",
176176
"name": "Post",
177177
"src": "src/pages/Post.tsx",
178178
"isDynamicEntry": true,
@@ -184,7 +184,7 @@
184184
]
185185
},
186186
"src/pages/ServiceArea.tsx": {
187-
"file": "assets/ServiceArea-B53mTnk2.js",
187+
"file": "assets/ServiceArea-DcTvJ0yM.js",
188188
"name": "ServiceArea",
189189
"src": "src/pages/ServiceArea.tsx",
190190
"isDynamicEntry": true,
@@ -196,7 +196,7 @@
196196
]
197197
},
198198
"src/pages/Services.tsx": {
199-
"file": "assets/Services-tpC5Qisr.js",
199+
"file": "assets/Services-BTa6cQCo.js",
200200
"name": "Services",
201201
"src": "src/pages/Services.tsx",
202202
"isDynamicEntry": true,
@@ -207,7 +207,7 @@
207207
]
208208
},
209209
"src/pages/Tariff.tsx": {
210-
"file": "assets/Tariff-D_KdO9V7.js",
210+
"file": "assets/Tariff-D-LYSzjX.js",
211211
"name": "Tariff",
212212
"src": "src/pages/Tariff.tsx",
213213
"isDynamicEntry": true,
@@ -218,17 +218,17 @@
218218
]
219219
},
220220
"src/pages/TouristVehicles.tsx": {
221-
"file": "assets/TouristVehicles-C83w9fib.js",
221+
"file": "assets/TouristVehicles-RrVKz8cY.js",
222222
"name": "TouristVehicles",
223223
"src": "src/pages/TouristVehicles.tsx",
224224
"isDynamicEntry": true,
225225
"imports": [
226226
"_SectionArt-CRGDPXOj.js",
227-
"_ServicePage-CUlAmDzQ.js"
227+
"_ServicePage-Bh0tG8oR.js"
228228
]
229229
},
230230
"src/pages/Town.tsx": {
231-
"file": "assets/Town-IKL8SGhs.js",
231+
"file": "assets/Town-CubG62Uz.js",
232232
"name": "Town",
233233
"src": "src/pages/Town.tsx",
234234
"isDynamicEntry": true,
@@ -240,13 +240,13 @@
240240
]
241241
},
242242
"src/pages/WeddingCars.tsx": {
243-
"file": "assets/WeddingCars-DPLJS-0u.js",
243+
"file": "assets/WeddingCars-Chn2e1h7.js",
244244
"name": "WeddingCars",
245245
"src": "src/pages/WeddingCars.tsx",
246246
"isDynamicEntry": true,
247247
"imports": [
248248
"_SectionArt-CRGDPXOj.js",
249-
"_ServicePage-CUlAmDzQ.js"
249+
"_ServicePage-Bh0tG8oR.js"
250250
]
251251
}
252252
}

‎404.html‎

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

‎about/index.html‎

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)