Fastly
Overview
This documentation describes a Fastly Compute@Edge implementation that detects traffic from AI search engines and agentic web crawlers using User-Agent analysis. The function routes AI systems to machine-optimized endpoints, improving how your content is consumed, interpreted, and referenced across the agentic web.
Architecture
Incoming Request → User-Agent Analysis → AI Bot Detection → Routing Decision → URL Rewrite
Key Components
AI Bot Detection Engine
Routing Logic
Configuration Management
Logging & Observability
AI Search Engine Bot Detection
Introduction
This implementation identifies traffic from AI search engines and agentic web crawlers such as ChatGPT, Perplexity, Gemini, Claude, Grok, and DeepSeek. The system routes these agents to specialized endpoints optimized for AI consumption, improving machine readability, model context accuracy, and your overall presence across the agentic web.
Configuration
AI Bot Pattern Configuration (config.json)
Routing Rules Configuration (routing.json)
Implementation
aiDetection.ts
routing.ts
main.ts (Fastly Compute@Edge)
Routing Methods
Path Prefix Routing
/docs/intro → /chatgpt/docs/intro
Subdomain Routing
example.com/page → claude.example.com/page
Parameter Routing
/guide → /guide?ai=perplexity
Monitoring & Analytics
Headers
X-AI-BotX-Original-URLX-AI-Optimized
Log Format
Deployment
Add files to your Compute@Edge project
Build the package
Upload & activate your service
Verify routing in staging
Deploy to production
That’s it! You have now successfully configured Limy router for your website. Data should begin to populate on your dashboard within an hour.
Last updated