FastCGI Cache VS WP Super Cache or use Together?

Posted October 22, 2018 5.4k views
NginxCachingUbuntu 16.04

I am confused about what I found on web and I want a PRO answer. Why someone would need wp super cache when you can cache dynamic php with FastCGI?

1 comment

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
1 answer

FastCGI cache is faster than WP Super Cache because the latter uses .htaccess and and PHP itself to route the visitor to the cache (files). So before the visitors get to a hit on a cached page, WP Super Cache has to performance some logic both in the form of .htaccess (rewrites) and PHP itself (all WP plugins must use php). Whereas FastCGI uses compiled bindings that are fast and routes traffic directly to the cache.

Now, an HTTP cache like Varnish will always be faster than the two. That’s because you’re traveling one fewer hop down the stack to get to the data, which in the case of Varnish sits at the HTTP level as an HTML object and can be served hot.

So to illlustrate:

So to get to the:

FastCGI cache: Nginx -> FastCGI -> File

WP Super Cache cache: Nginx -> FastCGI -> PHP -> File

Varnish cache: HTTP

  • Very helpful answer. From your answer I understood that varnish is the winner. Do you recommend using varnish + lemp stack, many people say use varnish only with apache, which are your thoughts on that?

  • This is such a fantastic and clear answer. However my opinion is that Varnish (and Varnish copycat like Litespeed) can cause too many conflicts for WordPress esp. WP Admin.

    I know Nginx FastCGI is few milliseconds slower but more reliable and easy to activate IMO