Website is very slow on first access but fast afterwards

Posted January 13, 2021 505 views
Server OptimizationDigitalOceanCachingInitial Server Setup

I recently noticed that when we try to access our site via a new browser. The first search takes a really long time to load. Almost a minute. Subsequent searches for the page lead to instant results. Some online research indicates it could be a server side issue. What settings can I change to stop this behavior?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Hi @jamboauction,

Usually, the Time To First Byte - TTTB is serverside, yes. Having said that, this can be caused from your application as well.

Looking into the server itself, there isn’t one option that you cna turn on and it to start working. What I’ll suggest is to try and optimize your server by using a caching service like Redis for instance.

Additionally, my recommendation would be to install OPcache for some server-side caching and add PHP-FPM to it.

Oh, and make sure you are using the latest PHP version.


Hi there,

I fully agree with what @KFSys mentioned. One extra thing that I could suggest is to open your browser developer tools and check the network tab and the console and look for some errors in there.

It is possible that the site is pulling very large images or other static assets which could also explain the slowness only for the first request.

Hope that this helps!