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.
- Standard page:
- Pre-rendered page:
Prerender.io and Akamai
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
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).
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).
In practice this means that you need to set the x-prerender-token header in the forwarded request to the token you got from the prerender website.
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.
A natural next step would be to cache the static results on the Edge. However, although crawlers typically generate a lot of traffic, they visit each page only once per crawl; By the time they crawl the same 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!