Skip to content

Commit

Permalink
Provide prefetch proxy advice for Google Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
Almad committed Mar 10, 2024
1 parent fdb0508 commit fd7ba6e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ddcz/templates/traffic-advice.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[{
"user_agent": "prefetch-proxy",
"google_prefetch_proxy_eap": {
"fraction": 1.0
}
}]
10 changes: 10 additions & 0 deletions ddcz/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
print_legacy_router,
name="legacy-router-print",
),
### Common pages for bots etc.
path(
"robots.txt",
TemplateView.as_view(template_name="robots.txt", content_type="text/plain"),
Expand All @@ -27,6 +28,15 @@
".well-known/security.txt",
TemplateView.as_view(template_name="security.txt", content_type="text/plain"),
),
# Prefetch for Google Chrome
# Courtesy of https://webmasters.stackexchange.com/a/139570
path(
".well-known/traffic-advice",
TemplateView.as_view(
template_name="traffic-advice.json",
content_type="application/trafficadvice+json",
),
),
### Creations and Creative Pages
path(
"rubriky/<creative_page_slug>/", views.creative_page_list, name="creation-list"
Expand Down

0 comments on commit fd7ba6e

Please sign in to comment.