Can anyone tell me how do these two cache work together? How does nginx know what cache to pull from first? what to ignore? or does it pull both? thanks in advance.
Asked
Active
Viewed 888 times
1 Answers
0
The W3-total-cache plugin stores a static version of the pages in a seperate folder structure.
On request for a page there is a check in the site configuration of NGINX to look for the static version first, and if it is not there, deliver the dynamic version.
The fastcgi cache of nginx does cache the answers from the fastcgi script.
So, on a request, the complete lookup order would be:
- NGINX fastcgi cache
- Static version from W3TotalCache
- Dynamic version

Thomas Berger
- 1,700
- 13
- 22
-
So does this mean that if it found 1. NGINX fastcgi cache active, it use fastcgi cache and ignore 2. and 3? – Raymond Rosenberg Jul 24 '18 at 14:24
-
Only if the page is found in the fastcgi cache. If the lookup in the fastcgi cache returns a miss, the W3TotalCache will be asked. – Thomas Berger Jul 24 '18 at 14:27
-
Gotcha. Do you advise to use both cache or do you think using w3-total-cache is pointless in this case? – Raymond Rosenberg Jul 24 '18 at 14:32
-
w3-total-cache writes static versions of the pages to hard-disk. these are persistent and don't vanish on a server restart or after time. Also, it takes care about the cached headers AFAIR, so i would recommend it. – Thomas Berger Jul 24 '18 at 14:41