Micro-caching in Nginx for High Performance

Author
Prateek Rungta
Published
Event
Bangalore Site Speed 6th Edition
Location & Date
·Online

In the vast, multi-layered subject area of web performance, server response time is an important metric. From a CMS standpoint, however, it is one of the most significant. Best practise recommends a 200ms or lower time-to-first-byte. For medium to high-traffic sites, server load is another vital statistic.

We were invited to talk about our learnings from optimising and hosting high-traffic sites such as Guiding Tech at the sixth edition of the Bangalore Site Speed Meetup.

Bangalore Site Speed Meetup 6th Event on YouTube.

In this talk we go over caching as a broad performance strategy, before dive into micro-caching as a specific approach to handle loads of 10 to 100 concurrent requests per second. We cover the filter, storage, and invalidation implementations1 of this caching strategy in Nginx. The talk concludes by comparing metrics of our caching strategy against a target of achieving sub-200ms TTFB response times for all visitors.

This talk is a newer revision of the Fortifying Craft CMS for High Traffic talk from 20192 which, as it says on the tin, was specifically tailored for Craft CMS based workflows. In this edition we focus on just micro-caching as a strategy and look at it independent of any specific CMS running at the application layer.