Home About Blog

Turpentine site slow first response

A question from a user:

Hello,
Today I’m checking my site and I see fast page loads only with the second load of the page.
also, I checked using this https://developers.google.com/speed/pagespeed/ and also see the best result only after the second attempt (after 30 sec)
Why is this?

That is standard behaviour for a Magento Turpentine site. Turpentine always makes the first request miss the cache to obtain a frontend cookie. This means that that first request cannot be cached, and takes longer as it needs to hit the origin. The second request is faster as it is served from section.io cache.

For this reason we normally recommend lifting personalisation to AJAX calls then setting up full HTML caching rather than use Turpentine. Full HTML caching can take full advantage of the cache for every request regardless of frontend cookie. This reduces load to the origin and delivers much better speed for an improved user experience.