Report this

What is the reason for this report?

FastCGI Cache VS WP Super Cache or use Together?

Posted on October 22, 2018
LS1

By LS1

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?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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

Heya,

Using WP Super Cache alongside FastCGI caching can be beneficial as they address different aspects of caching. FastCGI caches PHP script outputs at the server level, which reduces the load by avoiding repeated execution of PHP code. WP Super Cache, on the other hand, creates static HTML files from WordPress content, which can be served quickly to users.

If you are new to caching, starting with FastCGI might be sufficient. Adding WP Super Cache could provide additional optimizations and management features specific to WordPress, such as easier cache management and integration with WordPress plugins.

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.