W3 Total Cache With SSL for Nginx Server, thats on Rackspace Cloud with PHP5-FPM – here are some tips to work with this complex setup keeping everything fine. It is not that easy unlike Apache2, it is not that difficult too. After SSL Grade Optimization, this part possibly is the last work for your WordPress setup. Google unlikely to penalize a good graded website with HTTPS (HTTP is fully different matter, the protocol is different), yet we must make our websites faster enough allow smooth crawling.
W3 Total Cache With SSL for Nginx Server : Work Manually Via SSH
If you have followed this kind of guide to Install WordPress with Nginx on Rackspace Cloud Server or something closer you read somewhere, that is kept everything including the file permission, ownership to fully default values, W3 Total Cache’s grandfather can not write on the files needed some changes. You should manually add via nano
or vi
text editor over ssh. Two files you will require to change on latest Debian and Ubuntu 14.04 are :
1 2 | /usr/share/nginx/html /etc/nginx/sites-available/default |
But you need to change the path from Performance > General Settings page :
---
W3 Total Cache will deliver you the needed changes via kind of Ajax based messages like we get the errors. All are related to this file :
1 | /etc/nginx/sites-available/default |
Your Nginx main config file. So every time during initial setup, not only you’ll need to add and save but also need to do config test :
1 | nginx -t |
and reload :
1 | service nginx reload |
W3 Total Cache With SSL for Nginx Server : Whats to Keep ON and Off for Debugging
W3 Total Cache can make the setup slowest possible with SSL. Mild caching should be done. The reason to use is to use the CDN, get a better First Byte Time etc. So, initially only keep these on :
Page cache (Disk Enhanced)
Database Cache (Disk) [[ Only if a separate server is not used. There is almost no need with Innodb… ]]
Object Cache (Disk)
Browser Cache
First test with these. Settings should go under main server {
block or location
block (does not matter for one domain setup). Test with both Webpagetest and Tools.Pingdom. Browser cache might require debugging. We are using PHP in a different way versus Apache2, we need some manual work like :
1 2 3 4 5 6 | set $cache_uri $request_uri; # POST requests directly delivers PHP pages if ($request_method = POST) { set $cache_uri 'null cache'; } |
Save time by making the server to check if really cache exists :
1 2 3 4 5 6 7 8 9 | location / { try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args ; } <pre> Set expires to max (25 years) : <pre> expires max; log_not_found off; access_log off; |
Matching with this, CDN should have a TTL of 50 years ( Rackspace Cloud Files or Akamai ) and DNS have a TTL of 50 years ( Rackspace Cloud DNS )
As we are using Nginx with PHP5-FPM on Rackspace’s high end server, serving as Page cache or without has only impact on TTFB. As there is enough chance to get 500 error pages, clear browser cache and manually test for SSL https logo
on address bar.
You will configure Minify and CDN later. Both are quite painful as some files usually need to be excluded.
Tagged With w3 total cache nginx optimal settings , W3 Total Cache Ssl CDN