I made my site faster in 2 minutes with one Chrome file

I was reading up on the Chrome Private Prefetch Proxy feature, and the moment I understood what it does, I jumped into my server logs. I wanted to see if Chrome had been hitting /.well-known/traffic-advice on my site and getting nothing back.

And guess what. It had.

A steady drip of 404s on that exact URL. Chrome was politely asking my server, “Hey, do you want me to preload your pages for the next visitor coming from search?” and my server was answering, “file not found, go away.” Every single time.

So I fixed it in under 2 minutes. Here is exactly what I did, why it matters, and how you can do the same on WordPress.

What is /.well-known/traffic-advice actually doing?

Since Chrome 103 (which shipped in 2022), Chrome has run a feature called the Private Prefetch Proxy. When someone is on Google Search and is about to click through to a result, Chrome can quietly preload that page through a privacy proxy. By the time the user clicks, the page is already partly loaded.

Google’s own data on this puts the LCP improvement at 20 to 30 percent on prefetched pages. LCP is a Core Web Vitals ranking factor. So this is a free Core Web Vitals improvement for new visitors arriving from search. That is the highest value traffic on most sites.

The catch: Chrome only does this if your site says yes. The way you say yes is by serving a tiny JSON file at exactly this path:

/.well-known/traffic-advice

If the file is missing, Chrome logs a 404 and moves on. No prefetch.

What goes in the file

Two valid formats. To opt in fully:

[{"user_agent": "prefetch-proxy", "fraction": 1.0}]

fraction: 1.0 means “you can prefetch 100 percent of incoming requests.” You can dial it down (0.5 = 50 percent) if you are worried about origin load, but for almost every site, 1.0 is correct.

To opt out completely:

[{"user_agent": "prefetch-proxy", "disallow": true}]

One thing that matters more than people think: the response has to be served with a specific MIME type or Chrome will ignore it.

Content-Type: application/trafficadvice+json

Plain application/json does not work. Plain text does not work. It has to be exactly that.

How I added it to WordPress

There are two clean ways to do this on a WordPress site.

Method 1: Add it via your theme’s functions.php

This is the option I used. It works regardless of file system access, and it stays in the theme, so it follows the site if you migrate hosts.

Drop this in your child theme functions.php:

add_action('init', function () {
    add_rewrite_rule(
        '^\.well-known/traffic-advice$',
        'index.php?traffic_advice=1',
        'top'
    );
});

add_filter('query_vars', function ($vars) {
    $vars[] = 'traffic_advice';
    return $vars;
});

add_action('template_redirect', function () {
    if (intval(get_query_var('traffic_advice')) !== 1) return;
    header('Content-Type: application/trafficadvice+json');
    header('Cache-Control: public, max-age=86400');
    echo '[{"user_agent":"prefetch-proxy","fraction":1.0}]';
    exit;
});

After dropping that in, go to Settings → Permalinks and click Save Changes. That flushes the rewrite rules. Done.

Method 2: Static file (if you have file system access)

Create a file at the root of your site:

/.well-known/traffic-advice

Content:

[{"user_agent":"prefetch-proxy","fraction":1.0}]

Then make sure your server returns the right MIME type. On Apache, add this to your .htaccess:

<Files "traffic-advice">
    ForceType application/trafficadvice+json
</Files>

On Nginx:

location = /.well-known/traffic-advice {
    default_type application/trafficadvice+json;
    add_header Cache-Control "public, max-age=86400";
}

A note on Cloudflare

If you run Cloudflare in front of WordPress (I do), the static file approach works without anything special, because Cloudflare just passes the path through to the origin. If you want to skip the origin entirely, you can ship the JSON from a Cloudflare Worker without touching your server.

How to verify it is working

Open your terminal and curl the URL:

curl -i https://yourdomain.com/.well-known/traffic-advice

You should see:

HTTP/1.1 200 OK
Content-Type: application/trafficadvice+json

[{"user_agent":"prefetch-proxy","fraction":1.0}]

If you see 404, the rewrite did not catch the URL. Try saving permalinks again. If you see the JSON, but Content-Type: text/html If the MIME type is wrong, Chrome will still ignore it.

Why is this worth doing today?

LCP improvement of 20 to 30 percent on the highest intent traffic on your site, for the cost of writing one rewrite rule. Almost every site I have looked at has the same 404 sitting in its logs right now, going unnoticed.

Check your server logs. If you see Chrome hitting /.well-known/traffic-advice and getting a 404, you are leaving free Core Web Vitals improvement on the table.

Add the file. Verify the MIME type. Ship it.

I will be watching my own LCP in PageSpeed Insights over the next few weeks and will update this post with the actual delta. If you implement it, send me your before-and-after numbers. I want to see them.

FAQ

Is /.well-known/traffic-advice only for Chrome?

Right now, yes. Only Chrome’s Private Prefetch Proxy uses this file. Safari, Firefox, and Edge ignore it. That said, Chrome is roughly 65 percent of global desktop browser share, so even a Chrome-only feature reaches most of your search traffic.

Will this slow down my server?

The opposite. Right now, Chrome is hitting your site, getting 404s, and walking away. Once you serve a real response, Chrome can prefetch on its own privacy proxy infrastructure, which means Google’s edge does the work, not your origin. The only cost on your side is serving a 47-byte JSON file.

What is a safe fraction value to start with?

1.0 is fine for almost everyone. If you have a tiny VPS or you are paranoid about origin load, start at 0.3 and scale up after a week of clean logs.

Do I need to add anything to robots.txt?

No. The traffic-advice file is independent of robots.txt. It only controls Chrome’s prefetch behavior, not crawler access.

Can I serve the file from a subdomain?

No. It has to be on the same origin as the pages you want prefetched. Each subdomain needs its own /.well-known/traffic-advice file.

How do I know if Chrome is actually prefetching my pages now?

Watch your access logs for the Sec-Purpose: prefetch;anonymous-client-ip header on incoming requests. Those are Chrome prefetches. If you see them, the system is working.

Picture of Phillip Stemann
Phillip Stemann
Phillip Stemann is an independent Technical SEO, GEO and WordPress consultant based in Denmark. He works hands-on with site audits, crawl optimization, Core Web Vitals and structured data, helping brands rank higher in Google and get cited by AI search tools like ChatGPT and Perplexity. Beyond consulting, Phillip builds SaaS products in the same space he advises on. He's the founder of Planzer (a daily planning app), Traculo (server-side tracking and attribution), and Mailnaptic (email marketing with AI-driven subscriber profiles). Building and running his own products means the strategies he recommends are the same ones he tests on real projects every week. Phillip writes about what he actually implements. His blog covers technical SEO, Generative Engine Optimization and WordPress performance with a focus on specific methods, real data and results you can replicate. No fluff, no theory without proof. He sends a weekly newsletter every Monday with the latest from his experiments and client work.

Related Posts

download pdf cloud

Download the blog post as a PDF

I’ve made all my blog posts as PDFs so you can easily download them and read them later or share them with a colleague or friend.

I made my site faster in 2 minutes with one Chrome file