For websites that have the large number of SEO pages and significantly high concurrent users, developers mainly face the problem of loading website fast. They try to optimize the java script but usually don't pay much attention to the server response time. Slow server response time can significantly impact your page rankings, page load time and user experience. In this article, I will cover the problems we face with server response time and how we can ensure it remains low.

How to reduce the server response time for SEO pages
Content Management System(CMS)
Most of the website rely on content management system to load the content for their website. Its easy to add update and manage your content there. For one such purpose we are using Strapi for our SEO pages. The main problem with the cms is as your content grows the query time of your pages grows as well . This happens because -
1. There are multiple content types and components that are attached to single entry in CMS.
2. Whenever we request a page from the CMS it has to combine all the content from different content types and components and present it in a single API response.
As the number of components increase the query using which strapi fetch the content from the DB becomes more complex which time to time increase the response time of our application.
Introducing a Caching Layer: Varnish

To tackle this problem we introduced the caching layer between the client and server.
Varnish is the caching layer that sits between your CMS and web application. It is specifically build to cache server responses and reduce the load on server or CMS. How varnish works -
1. The first request passes through it and while the request is going back it caches the content so first time it gives the MISS signal to the user and caches the response.
2. The next time when the same request comes it gives the cached response to the user
3. We can write a config for varnish where we can decided for how much time we have to cache the content, how to invalidate the cache.
The drastically reduces the server response time, as now the request does not hit the CMS to get the content it is now served from varnish.
Impact
- Fast page load times
- Reduces the load on CMS for each request
- Better page performance
- During traffic hikes the system remains stable


