Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /.well-known/traffic-advice file for 404 reduction and, of course, for Chrome Privacy Preserving Prefetch Proxy #440

Closed
jasomdotnet opened this issue Jun 8, 2022 · 4 comments
Labels
In progress planned This request will be implemented

Comments

@jasomdotnet
Copy link

Hi, first of all - great job with the WordOps!

Now the feature suggestion:

I have been investigating logs recently and found lot of "404, page not found" requests by "Chrome Privacy Preserving Prefetch Proxy" bot.

TLTR: Google preloads page for Chrome users which browser thinks user is going to visit next (or what). File under the URL https://www.exampe.com/.well-known/traffic-advice informs this proxy bot how often prefetch and if at all. Something like robots.txt but for users.

I suggest to add file /var/www/html/.well-known/traffic-advice with content

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

and extend /etc/nginx/common/locations-wo.conf with the config:

# Private Prefetch Proxy
# https://developer.chrome.com/blog/private-prefetch-proxy/
location /.well-known/traffic-advice {
   types { } default_type "application/trafficadvice+json; charset=utf-8";
   alias /var/www/html/.well-known/traffic-advice;
   allow all;
}

More info and config test tool here

@VirtuBox
Copy link
Member

Hello @jasomdotnet,
this will be added in the next WordOps release.

@VirtuBox VirtuBox added this to In progress in WordOps v4.0 Jun 14, 2022
@VirtuBox
Copy link
Member

VirtuBox commented Sep 9, 2022

@jasomdotnet Does I have to create the empty directory /var/www/html/.well-known/traffic-advice or it's not required ?

@jasomdotnet
Copy link
Author

@VirtuBox, I did not get your question

traffic-advice is a text file (text response on the request example.com/.well-known/traffic-advice) with the content like

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

and with a special mime type achieved by the config

# Private Prefetch Proxy
# https://developer.chrome.com/blog/private-prefetch-proxy/
location /.well-known/traffic-advice {
   types { } default_type "application/trafficadvice+json; charset=utf-8";
   alias /var/www/html/.well-known/traffic-advice;
   allow all;
}

@VirtuBox
Copy link
Member

@jasomdotnet okay thanks. I'm going to add it to WordOps.

@VirtuBox VirtuBox added the planned This request will be implemented label Sep 11, 2022
@VirtuBox VirtuBox moved this from In progress to Done in WordOps v4.0 Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In progress planned This request will be implemented
Projects
WordOps v4.0
  
Done
Status: Done
Development

No branches or pull requests

2 participants