<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/four-lines-in-head-changed-my-site-speed-nclnhdt0z" -->

---
title: Four Lines in <head> Changed My Site Speed | daily.dev
description: Adding four HTML resource hint directives — preload, prefetch, and preconnect — to the <head> element can reduce Largest Contentful Paint (LCP) by...
canonical: https://daily.dev/posts/four-lines-in-head-changed-my-site-speed-nclnhdt0z
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Four Lines in <head> Changed My Site Speed | daily.dev
og:description: Adding four HTML resource hint directives — preload, prefetch, and preconnect — to the <head> element can reduce Largest Contentful Paint (LCP) by...
og:url: https://daily.dev/posts/four-lines-in-head-changed-my-site-speed-nclnhdt0z
og:image: https://api.daily.dev/og/posts/NclNhdt0Z.png
og:image:alt: Four Lines in <head> Changed My Site Speed
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Four Lines in <head> Changed My Site Speed

**[Medium Friends](https://daily.dev/sources/mediumfriends)** · [@tusharkanjariya](https://daily.dev/tusharkanjariya) · 1 min read · 0 upvotes · 0 comments

## Summary

Adding four HTML resource hint directives — preload, prefetch, and preconnect — to the <head> element can reduce Largest Contentful Paint (LCP) by approximately 600ms. These <link> attributes give the browser early context about critical resources, improving page load performance with minimal code changes.

## Content

I added 4 lines to my <head> and cut ~600ms from LCP.

Most of us only use <link> for stylesheets — but that leaves performance on the table.

preload, prefetch, and preconnect give the browser context it doesn’t have by default.

Simple change, real impact.

Full breakdown:

[Read More](https://medium.com/@TusharKanjariya/four-lines-in-head-changed-my-site-speed-449bfeb396a2)

## Similar posts on daily.dev

- [Web Performance 2025: The Shift from Optimization to Prediction](https://daily.dev/posts/web-performance-2025-the-shift-from-optimization-to-prediction-emdlyovyv) · Web Performance Calendar · 0 upvotes · 0 comments
- [Improve Website UX with Chrome DevTools and Core Web Vitals.](https://daily.dev/posts/improve-website-ux-with-chrome-devtools-and-core-web-vitals--brpkpxkzp) · Medium · 2 upvotes · 0 comments
- [Image Optimization for Core Web Vitals in 2026: What Actually Moves the Needle](https://daily.dev/posts/image-optimization-for-core-web-vitals-in-2026-what-actually-moves-the-needle-jzw6k1lio) · SitePoint · 11 upvotes · 0 comments
- [Insights from 100 site speed reviews in 2025](https://daily.dev/posts/insights-from-100-site-speed-reviews-in-2025-yh4tk3cne) · Web Performance Calendar · 0 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#html](https://daily.dev/tags/html)

[View this post on daily.dev](https://daily.dev/posts/four-lines-in-head-changed-my-site-speed-nclnhdt0z)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/four-lines-in-head-changed-my-site-speed-nclnhdt0z","headline":"Four Lines in <head> Changed My Site Speed","text":"Adding four HTML resource hint directives — preload, prefetch, and preconnect — to the <head> element can reduce Largest Contentful Paint (LCP) by approximately 600ms. These <link> attributes give the browser early context about critical resources, improving page load performance with minimal code changes.","url":"https://daily.dev/posts/four-lines-in-head-changed-my-site-speed-nclnhdt0z","datePublished":"2026-04-06T07:52:48.485Z","dateModified":"2026-04-06T07:53:08.106Z","author":{"@type":"Person","name":"Tushar Kanjariya","url":"https://daily.dev/tusharkanjariya","image":"https://lh3.googleusercontent.com/a/AAcHTtdab-lJjLSezfgwOCJ_As2LpD1Q1BycSnXKf5FRRg=s96-c","description":"Full-Stack Developer and Medium Writer","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":120}},"image":"https://media.daily.dev/image/upload/s--bS38aS66--/f_auto/v1775461970/posts/NclNhdt0Z?_a=BAMAMiWQ0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/mediumfriends","name":"Medium Friends"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium Friends","item":"https://daily.dev/squads/mediumfriends"},{"@type":"ListItem","position":3,"name":"Four Lines in <head> Changed My Site Speed"}]}
```

