Speed up page loads when working with Statamic's SEO Pro locally
April 11th 2021
|
Reading time 1 min Yesterday I was working on a Statamic site and I noticed the load times were a bit slower than normal. So I started investigating. I quickly found the culprit thanks to Laravel Debugbar. It was the Statamic's SEO Pro addon:
With SEO Pro enabled:
Without SEO Pro enabled:
Yikes, almost a second extra load time. As I don't need good SEO locally the solution was simple: only render the seo tag when the environment is not local. So I added a if around the tag:
{{# base.antlers.html #}}
{{ if environment != 'local' }}
{{ seo_pro:meta }}
{{ /if }}
So if you are not working with Laravel Debugbar yet, go install it. It's truly an essential tool when developing with Laravel.