1. Home
  2. Performance
  3. How Does Pagely’s Caching Layer…

How Does Pagely’s Caching Layer Work?

Our PressCACHE™ service is backed by NGINX‘s powerful and robust caching technology. This is a key component of our architecture that produces extremely fast performance for your WordPress sites, while helping maximize the scalability of your Pagely VPS. Let’s do a quick overview of how our full-page NGINX caching layer works.

How Our Caching Layer Works

A visitor arrives at a page on your site. Pagely caching technology decides if it’s safe to serve them a cached page based on the following criteria:

  • If they are logged into WordPress, we can not, since there may be user-specific (i.e., private) content on the page.
  • If they have a cookie marking them as commenter, we can not cache (all the comment forms will be populated with the user’s email/name).
  • If they have a PHP session started, we can not cache, since the page might be pulling a value that is unique to that user from that session, and caching that would expose private data.
  • We make sure it is a GET request, since we would not want to cache a from POST.

If it is safe to serve a cached page, we build a key that represents that page (URL, HTTP/HTTPS, browser type) and check if we have a copy of that page already in the cache. If we do, we serve that page from the cache. If we do not have that page in the cache, the page is processed normally — we hit PHP, generate a new copy, and add it to the cache before serving the results. Note: If the page sets a cookie, or returns an error, we do not cache it.

Customizing Your Caching Rules

Both our CDN and caching layers are integrated into your WordPress instance such that it refreshes the relevant assets automatically when you publish or modify a post. This allows us the control to make custom rules for your specific WordPress sites.

With added flexibility, we can create a more personalized user experience for your visitors.

The Importance of Optimizing Your WordPress Site

Depending on your unique site’s content, code efficiency and other variables, our caching layer has the capability of serving thousands of requests per second. Compare this to the PHP layer which can serve roughly ten requests per second. For easy scaling, we recommend maximizing the cache usage and only use PHP for things that truly need to be dynamic.

Identifying and implementing these tweaks are what our team of experts is here for. We encourage our customers to pick our brains and monitor how we can achieve better results for your website. Just send in a support ticket if you’re working to improve performance and we’ll be happy to consult with you.

Was this article helpful?