I used wpfc command to create the server for a single Wordpress site.
By default, it has W3 Total Cache installed.
In the other post, DaveNaylor mentioned that W3 Total Cache is used to confgure memcache. And leave other settings off.
I am using gtmetrix to test the wordpress site. Yslow keeps on saying that expire headers are missing, and there are etags issue.
To solve this problem, I enabled “Browser Cache”, and ticked all the boxes, such as “Set Expires Header”, “Set Entity Etag (Etag)”
Then I purged the cache in Wordpress Admin, and then I used these command:to reload the server:
ee stack reload ee clean --all
I went back to the gtmetrix website, Yslow still indicate Expire Header and etag are not set correctly, and marked as F
I googled, some people say that put these into .htaccess file under htdocs directory, so I put these code:
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType text/css "access plus 60 days"
ExpiresByType text/javascript "access plus 60 days"
ExpiresByType image/ico "access plus 60 days"
ExpiresByType image/jpg "access plus 60 days"
ExpiresByType image/jpeg "access plus 60 days"
ExpiresByType image/gif "access plus 60 days"
ExpiresByType image/png "access plus 60 days"
ExpiresByType text/css "access plus 60 days"
ExpiresByType text/html "access plus 60 days"
</IfModule>
Header unset ETag
FileETag None
It does not work neither.
Then, I googled, and someone say that you should modify your nginx configuration file. I used Winscp, and located the file under directory: /etc/nginx/sites-enabled
It currently has these code, should I modify these code? Would it break the system?
server {
server_name 45.63.XXX.XXX www.45.63.XXX.XXX;
access_log /var/log/nginx/45.63.xxx.xxx.access.log rt_cache;
error_log /var/log/nginx/45.63.xxx.xxx.error.log;
root /var/www/45.63.xxx.xxx/htdocs;
index index.php index.html index.htm;
include common/wpfc.conf;
include common/wpcommon.conf;
include common/locations.conf;
include /var/www/45.63.xxx.xxx/conf/nginx/*.conf;
}
Can anyone point the correct direction to add expire header and config the etags?
Ps. I am using a brand new server Ubuntu 14.04 (64X), installed easyengine, and single site with this command ee site create 45.63.XXX.XXX --wpfc