This article covers the basics of a prerender service and gives you a rundown of how you can get started.
How Does prerender.io Work?
In the SEO world, the trend is to serve pre-rendered HTML pages when a crawler visits the site.
The prerender.io service expects the full URL as the path.
Here's the difference between a Standard URL and a Pre-render URL
A URL with prerender.io will appear with the base URL: https://service.prerender.io/.
Prerender.io and Akamai
Akamai itself does not offer prerendering, however, we work nicely together with a prerender service like prerender.io in both deployment options (customer origin or prerender.io SaaS offering)
Here is how you can easily add a service like prerender.io into your delivery.
- Detect crawlers
- Send crawler requests to prerender service
- Modify request path
Step 1: Detect crawlers
Detecting the key crawlers can be done based on the user-agent request header. (If you use Bot Manager, you’ll have more flexibility and better results).
Step 2: Send crawler requests to prerender service
There’s nothing fancy to do here. Whenever the user agents are detected we forward them to another origin (either service.prerender.io or to the customer web server running prerender.io). Make sure to set these two key settings to origin hostname:
- Cache key hostname: Origin Hostname
- Forward host header: Origin Hostname
Note: Depending on the setup, a token might be required to send to the prerender.io service (this can be done using the modify outgoing request header behavior).
Step 3: Modify request path
We still need to change the outgoing request path. It needs to be the full URL. This can be achieved by using property variables and modifying the outgoing request path behavior.
Step 4: Do not cache
A natural next step would be to cache the static results on the Edge. However, crawlers typically generate a lot of traffic. By the time they crawl a page for the second time, the cached version is either evicted or no longer up to date.
So checking the edge cache, checking the parent cache, and going forward to origin is slower than going straight to origin. Going to origin gives you the benefits of SureRoute and persistent connections.
This is a very simple way to use Akamai to solve this common problem as people move to JS Frameworks. Using Akamai and prerender.io will allow you to quickly improve your SEO without needing to manually shift meta tags or translate your code.
We hope this improves your SEO and makes your life a little bit easier!