I'm preparing a server to host a classic WordPress site (lots of dynamic content).

I have an apache server associated with a Nginx reverse proxy ( with the proxy_pass configuration ). I have several ideas to advance my NGINX configuration: A) distribute the static part via the reverse proxy without going through a cache system. B) Cache with Fastcgi_cache with many filters to exclude dynamic content. C) Cache with proxy_cache with many filters to exclude dynamic content.

What is the most logical solution?

1 Answer 1


If Apache2 and nginx both can access the same filesystem, then it is more efficient that nginx directly serves all static assets. That is how I have configured a similar setup. Therefore option A should be always applied.

If you want to replace Apache2 with PHP-FPM, then you can use option B to cache output from PHP scripts.

With your current setup, you can use option C to cache PHP script output.

I would estimate that biggest gains in performance would happen with caching PHP script content. The more you can cache as static files, the more CPU you save and the faster the site is.

You should also consider adding cache flushing from WordPress side, so that cache gets flushed whenever content is updated. However, without closer knowledge on the nature of your dynamic content, I don't know how effective this would be.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .