How Prefetching Boosted Terra’s Ad Clicks

Patient Tools

Read, save, and share this guide

Use these quick tools to make this medical article easier to read, print, save, or share with a family member.

Article Summary

In this comprehensive guide, we will delve into the world of prefetching and how it played a pivotal role in increasing ad clicks for Terra, a fictional company. We will break down the concept of prefetching into simple, plain English, and provide step-by-step guides on optimizing it. Our aim is to make this technical topic accessible to everyone, enhance readability, and ensure that search engines...

Key Takeaways

  • This article explains Prefetching strategy  in simple medical language.
  • This article explains Business Impact  in simple medical language.
  • This article explains Technical details  in simple medical language.
  • This article explains Terra's Challenge: Boosting Ad Clicks in simple medical language.
Educational health guideWritten for patient understanding and clinical awareness.
Reviewed content workflowUse writer and reviewer profiles for stronger trust.
Emergency safety firstUrgent warning signs are highlighted below.

Seek urgent medical care if you notice

These warning signs are general safety guidance. Local emergency numbers and clinical judgment should always come first.

  • Severe symptoms, breathing difficulty, fainting, confusion, or rapidly worsening illness.
  • New weakness, severe pain, high fever, or symptoms after a serious injury.
  • Any symptom that feels urgent, unusual, or unsafe for the patient.
1

Emergency now

Use emergency care for severe, sudden, rapidly worsening, or life-threatening symptoms.

2

See a doctor

Book a professional medical evaluation if symptoms persist, worsen, recur often, affect daily activities, or occur in a high-risk patient.

3

Learn safely

Use this article to understand possible causes, tests, treatment options, prevention, and questions to ask your clinician.

In this comprehensive guide, we will delve into the world of prefetching and how it played a pivotal role in increasing ad clicks for Terra, a fictional company. We will break down the concept of prefetching into simple, plain English, and provide step-by-step guides on optimizing it. Our aim is to make this technical topic accessible to everyone, enhance readability, and ensure that search engines can easily discover and rank this article. Let’s dive right in.

1. Understanding Prefetching

What is Prefetching?

Prefetching is like having a crystal ball for your web browser. It’s a smart technique that predicts what web pages or resources you might visit next and preloads them in the background. This makes your browsing experience faster because the pages are ready to go when you click on them.

Why is Prefetching Important?

Imagine waiting for a slow webpage to load every time you click on a link. Prefetching saves you from that frustration by fetching and storing web content you’re likely to visit. It’s like having your favorite snacks ready before you get hungry.

How Does Prefetching Work?

Behind the scenes, your browser uses algorithms and your browsing history to guess which pages you’ll visit. It then quietly loads them in the background, so when you do click, it’s almost instantaneous. Think of it as your browser being one step ahead of you.

Prefetching strategy 

Prefetching has been around for a while, but it is important to use it carefully as it consumes extra bandwidth for resources that are not immediately necessary. This technique should be applied thoughtfully to avoid unnecessary data usage. In the case of Terra, articles are prefetched if the following conditions are met:

  • Visibility of links to prefetched articles: Terra used the Intersection Observer API to detect viewability of the section containing the articles that they wanted to prefetch.
  • Favorable conditions for increased data usage: As mentioned previously, prefetching is a speculative performance improvement that consumes extra data, and that may not be a desirable outcome in every situation. To reduce the likelihood of wasting bandwidth, Terra uses the Network Information API along with the Device Memory API to determine whether to fetch the next article. Terra only fetches the next article when:
    • The connection speed is at least 3G and the device has at least 4GB of memory,
    • or if the device is running iOS.
  • CPU idle: Finally, Terra checks if the CPU is idle and able to perform extra work by using requestIdleCallback, which takes a callback to be processed when the main thread is idle, or by a specific (optional) deadline—whichever comes first.

Adhering to these conditions ensures that Terra only fetches data when necessary, which saves bandwidth and battery life, and minimizes the impact of prefetches that end up going unused.

When these conditions are met, Terra prefetches the articles present in the sections: “Related Content” and “Recommended for you” highlighted in blue below.

Business Impact 

In order to measure the impact of this technique, Terra first launched this feature in the “Related content” section of the article page. A UTM code helped them to differentiate between prefetched and non-prefetched articles for comparison purposes. After two weeks of successful A/B testing, Terra decided to add the prefetching functionality to the “Recommended for you” section.

As a result of prefetching articles, an overall increase of ads metrics and a reduction of LCP and Time to First Byte (TTFB) times were observed:

MetricMobileDesktop
Ads CTR+11%+30%
Ads viewability+10.5%+6%
LCP-51%-73%
TTFB-83%-84%

Prefetching—when used with care—greatly improves page load time, increases ads metrics, and reduces LCP time.

Technical details 

Prefetching can be achieved through the use of resource hints such as rel=prefetch or rel=preload, via libraries such as quicklink or Guess.js, or using the newer Speculation Rules API. Terra has chosen to implement this by using the fetch API with a low priority in combination with an Intersection Observer instance. Terra made this choice as it allows them to support Safari, which doesn’t yet support other prefetching methods like rel=prefetch or the Speculation Rules API, and a full-featured JavaScript library wasn’t necessary for Terra’s needs.

The below JavaScript is approximately equivalent to the code used by Terra:

function prefetch(nodeLists) {
  // Exclude slow ECTs < 3g
  if (navigator.connection &&
    (navigator.connection.effectiveType === 'slow-2g'
      || navigator.connection.effectiveType === '2g')
  ) {
    return;
  }

  // Exclude low end device which is device with memory <= 2GB
  if (navigator.deviceMemory && navigator.deviceMemory <= 2) {
    return;
  }

  const fetchLinkList = {};

  const observer = new IntersectionObserver(function (entries) {
    entries.forEach(function (entry) {
      if (entry.isIntersecting) {
        if (!fetchLinkList[entry.target.href]) {
          fetchLinkList[entry.target.href] = true;

          fetch(entry.target, {
            priority: 'low'
          });
        }

        observer.unobserve(entry = entry.target);
      }
    });
  });
}

const idleCallback = window.requestIdleCallback || function (cb) {
  let start = Date.now();

  return setTimeout(function () {
    cb({
      didTimeout: false,
      timeRemaining: function () {
        return Math.max(0, 50 - (Date.now() - start));
      }
    });
  }, 1);
}

idleCallback(function () {
  prefetch(nodeLists)
})

 

  • The prefetch function first checks for a minimum connection quality and device memory before initiating prefetching.
  • Then it uses an IntersectionObserver to monitor when elements become visible in the viewport, and subsequently adds URLs to a list for prefetching.
  • The prefetching process is scheduled, aiming to execute the prefetch function when the main thread is idle.

Terra’s Challenge: Boosting Ad Clicks

Terra’s Story

Terra, our imaginary company, had a common problem. They were running online ads, but people weren’t clicking on them as much as they’d hoped. It’s like having a flashy billboard but no one stopping to look.

The Role of Prefetching

Here’s where prefetching comes into play. Terra decided to implement prefetching on their website. This meant that when someone visited their site, the browser started predicting which pages the user might click on next, especially those related to ads. It was like having a sneak peek into users’ thoughts.

Step-by-Step Guide to Optimizing Prefetching

Step 1: Identifying Key Content

Start by figuring out what content on your website is crucial. For Terra, it was their ads. Identify what you want to prefetch – whether it’s product pages, blog posts, or something else.

Step 2: Implementing Prefetching

This is where the magic happens. You need to add a bit of code to your website. Don’t worry; you don’t need to be a coding expert. You can find easy-to-follow guides or hire a developer to do this for you.

Step 3: Testing and Monitoring

Once the prefetching is in place, it’s essential to keep an eye on how it’s performing. Terra used tools to track how many ads were being loaded in the background and how often they were being clicked.

Step 4: Continuous Optimization

Prefetching isn’t a one-time fix. You need to keep fine-tuning it. If you notice certain pages aren’t being clicked as expected, adjust your prefetching strategy accordingly.

The Importance of Prefetching

Faster Page Loading

Prefetching ensures that pages load almost instantly when clicked. Users love fast websites, and they are more likely to engage with your content if they don’t have to wait.

Improved User Experience

Imagine visiting a website where everything feels lightning-fast. That’s the kind of experience prefetching delivers. Users stay longer, explore more, and are more likely to click on ads or make purchases.

Enhanced SEO and Search Engine Visibility

Search engines also appreciate fast-loading websites. When your site loads quickly, search engines are more likely to rank it higher in search results. This means more people discover your content.

Conclusion

In this guide, we demystified prefetching and showed how it transformed Terra’s ad click rates. Prefetching isn’t just for tech wizards; it’s a tool that anyone can use to improve their website’s speed, user experience, and SEO. By implementing prefetching and following our step-by-step guide, you can make your website faster and more appealing to both users and search engines. So, what are you waiting for? Start prefetching and watch your online presence soar.

Patient safety assistant

Check your symptom safely

Hi, I am RX Symptom Navigator. I can help you understand what to read next and what warning signs need care.
Warning: Do not use this in emergencies, pregnancy, severe illness, or as a substitute for a doctor. For children or teens, use with a parent/guardian and clinician.
A rural-friendly guide: warning signs, when to see a doctor, related articles, tests to discuss, and OTC safety education.
1 Symptom 2 Severity 3 Safe guidance
First safety question

Is there chest pain, breathing trouble, fainting, confusion, severe bleeding, stroke-like weakness, severe injury, or pregnancy danger sign?

Choose quickly

Browse by body area
Start here: Write or select a symptom. The guide will show warning signs, doctor guidance, diagnostic tests to discuss, OTC safety education, and related RX articles.

Important: This tool is educational only. It cannot diagnose, treat, or replace a doctor. OTC information is not a prescription. In an emergency, contact local emergency services or go to the nearest hospital.

Doctor visit helper

Prepare before seeing a doctor

A simple rural-patient checklist to help you explain symptoms clearly, ask better questions, and avoid unsafe self-treatment.

Safety note: This is not a prescription or diagnosis. For severe symptoms, pregnancy danger signs, children with serious illness, chest pain, breathing difficulty, stroke-like weakness, or major injury, seek urgent care.

Which doctor may help?

Start with a registered doctor or the nearest qualified health center.

What to tell the doctor

  • Write when the problem started and how it changed.
  • Bring old prescriptions, investigation reports, and current medicines.
  • Write allergies, pregnancy status, diabetes, kidney/liver disease, and major past illnesses.
  • Bring one family member if the patient is weak, elderly, confused, or a child.

Questions to ask

  • What is the most likely cause of my symptoms?
  • Which danger signs mean I should go to hospital quickly?
  • Which tests are necessary now, and which can wait?
  • How should I take medicines safely and what side effects should I watch for?
  • When should I come for follow-up?

Tests to discuss

  • Vital signs: temperature, pulse, blood pressure, oxygen saturation
  • Basic physical examination by a clinician
  • CBC, urine test, blood sugar, or imaging only when clinically needed

Avoid these mistakes

  • Do not use antibiotics, steroid tablets/injections, or strong painkillers without proper medical advice.
  • Do not hide pregnancy, kidney disease, ulcer, allergy, or blood thinner use.
  • Do not delay emergency care when danger signs are present.

Medicine safety and first-aid guide

This section is for patient education only. It does not replace a doctor, pharmacist, or emergency care.

Safe first steps

  • Avoid heavy lifting, sudden bending, and prolonged bed rest.
  • Use comfortable posture and gentle movement as tolerated.
  • Discuss physiotherapy, X-ray, or MRI only when clinically needed.

OTC medicine safety

  • For mild back pain, pain-relief medicine may be discussed with a doctor or pharmacist.
  • Avoid repeated painkiller use if you have kidney disease, stomach ulcer, uncontrolled blood pressure, or are taking blood thinners.

Avoid these mistakes

  • Do not start antibiotics without a proper medical decision.
  • Do not use steroid tablets or injections casually for quick relief.
  • Do not delay emergency care because of home remedies.

Get urgent help if

  • Back pain with leg weakness, numbness around private area, loss of urine/stool control, fever, cancer history, or major injury needs urgent care.
Medicine names, dose, and timing must be decided by a qualified clinician or pharmacist after checking age, pregnancy, allergy, other diseases, and current medicines.

For rural patients and family caregivers

Patient health record and symptom diary

Write your symptoms, medicines already taken, test results, and questions before visiting a doctor. This note stays on your device unless you print or copy it.

Doctor to discuss: Doctor / qualified healthcare provider
Tests to discuss with doctor
  • Basic vital signs: temperature, pulse, blood pressure, oxygen level if needed
  • Relevant blood, urine, imaging, or specialist tests only after clinical assessment
Questions to ask
  • What is the most likely cause of my symptoms?
  • Which warning signs mean I should go to emergency care?
  • Which tests are really needed now?
  • Which medicines are safe for my age, pregnancy status, allergy, kidney/liver/stomach condition, and current medicines?

Emergency warning signs such as chest pain, severe breathing difficulty, sudden weakness, confusion, severe dehydration, major injury, or loss of bladder/bowel control need urgent medical care. Do not wait for online information.

Safe pathway to proper treatment

Back pain care roadmap

Use this simple roadmap to understand the next safe steps. It is educational and does not replace examination by a doctor.

Go to emergency care if you notice:
  • New leg weakness, numbness around private area, or loss of bladder/bowel control
  • Back pain after major injury, fever, unexplained weight loss, cancer history, or severe night pain
Doctor / service to discuss: Orthopedic/spine specialist, physical medicine doctor, physiotherapist under guidance, or qualified clinician.
  1. Step 1

    Check danger signs first

    If danger signs are present, seek emergency care and do not wait for online information.

  2. Step 2

    Record the symptom story

    Write when symptoms started, severity, medicines already taken, allergies, pregnancy status, and test results.

  3. Step 3

    Visit a qualified clinician

    A doctor, nurse, or qualified healthcare provider can examine you and decide which tests or treatment are needed.

  4. Step 4

    Do only useful tests

    Discuss neurological examination first. X-ray or MRI may be needed only when red flags, injury, nerve weakness, or persistent severe symptoms are present.

  5. Step 5

    Follow up and return early if worse

    If symptoms worsen, new warning signs appear, or treatment is not helping, return for review quickly.

Rural patient practical tips
  • Take a written symptom diary and all previous prescriptions/test reports.
  • Do not hide medicines already taken, even herbal or over-the-counter medicines.
  • Ask which warning signs mean urgent referral to hospital.
  • Avoid forceful massage or bone-setting when there is weakness, injury, fever, or nerve symptoms.

This roadmap is for education. A real diagnosis and treatment plan requires history, examination, and clinical judgment.

RX Patient Help

Ask a health question safely

Write your symptom story. A health professional or site editor can review it before any answer is prepared. This box is not for emergency care.

Emergency first: Severe chest pain, breathing trouble, unconsciousness, stroke signs, severe injury, heavy bleeding, or rapidly worsening symptoms need urgent local medical care now.

Frequently Asked Questions

Is this article a replacement for a doctor?

No. It is educational content only. Patients should consult a qualified clinician for diagnosis and treatment.

When should I seek urgent care?

Seek urgent care for severe symptoms, rapidly worsening condition, breathing difficulty, severe pain, neurological changes, or any emergency warning sign.

References

Add references, clinical guidelines, textbooks, journal articles, or trusted medical sources here. You can edit this area from the RX Article Professional Blocks panel.