I'm Srinivasan
Lead Consultant
@srinivasanskr
srinivasanTarget
source: https://gtmetrix.com/
const po = new PerformanceObserver((list) => {
let entries = list.getEntries();
entries = dedupe(entries, "startTime");
entries.forEach((item, i) => {
console.dir(item);
console.log(
`${i + 1} current LCP item : ${item.element}: ${item.startTime}`,
);
item.element ? (item.element.style = "border: 5px dotted lime;") : "";
});
const lastEntry = entries[entries.length - 1];
console.log(`LCP is: ${lastEntry.startTime}`);
});
po.observe({ type: "largest-contentful-paint", buffered: true });
function dedupe(arr, key) {
return [...new Map(arr.map((item) => [item[key], item])).values()];
}
Cache-Control
no-store: Disable Cache
public/private: is CDN involved ?
max-age=n: until when to cache
must-revalidate: force discard cache after max-age
ETag
Beneficial in case of large files
Allows browser to validate the local cache with minuscule n/w call
OPTIMISATIONS
OPTIMISATIONS
Pointerup
mouse up
click
Render
Paint
more
Processing Time
Input Delay
Presentation Delay
Blocking Tasks
Interaction to Next Paint
BLOCKING
RESOURCES
BLOCKING RESOURCES
Defer Non-Critical CSS
Remove unused CSS
Modify/Compress CSS
References
https://web.dev/blog/inp-cwv-march-12
https://developers.google.com/search/docs/appearance/core-web-vitals
https://gtmetrix.com/
https://webperf-snippets.nucliweb.net/
https://www.linkedin.com/in/joanleon/
https://www.linkedin.com/in/addyosmani/
https://www.linkedin.com/in/jecfish/