Welcome Guest. Please Login or Register  


You are here: Index > Webuzo > General Support > Topic : Wordpress Cache plugin with Nginx



Normal Mode | Print  

Wordpress Cache plugin with Nginx
awran5
Group: Member
Post Group: Newbie
Posts: 3
Status:
Thank you,

But i found better way to solve all "Enable compression" and "Leverage browser caching" problems with Nginx. you don't need all previous codes, even it works without any cache plugins like W3 total cache or WP super cache.

i posted this little tutorial at webhostingtalk but i like to share it with softculous fans.

Tested on CentOS 6.4 with Webuzo installed and Ubuntu 12.04 only LEMP installed.

Step 1: add this code just after the server name line:

- If you use centos / webuzo:
PHP Code

 vi /usr/local/apps/nginx/etc/conf.d/webuzoVH.conf 



Note: as (valley) mentioned webuzoVH.conf file is rebuilt every time you add/delete a domain and other cases.

- If you use ubuntu:
PHP Code

 nano /etc/nginx/sites-enabled/yoursite 



The code is:

PHP Code

 server_name yoursite.com;

# Define default caching of 1 week
expires 31536000s;
add_header Pragma public;
add_header Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate";  

gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml a



Step 2: make sure gzip is on

Edit or add these lines in:

- If you use centos / webuzo: in the Enduser panel > Nginx

- If you use ubuntu:
PHP Code

 nano /etc/nginx/nginx.conf 



The code is:

PHP Code

 gzip  on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 5;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;
gzip_disable “MSIE [1-6].(?!.*SV1)



And finally restart Nginx:

PHP Code

 sudo service nginx restart 



That's all, now delete your browser cache and refresh the page and your page speed result should be over 90/100  ;-D

.
IP: --   


Threads
 9tablets   Wordpress Cache plugin with Nginx, Enable compression, Leverage browser caching problems (6 Replies, Read 39461 times)
    |--  valley   Sir all of...   on October 16, 2013, 4:48 am
    |--  awran5   No way, i...   on October 16, 2013, 6:00 am
    |--  valley   You can follow...   on October 16, 2013, 10:15 am
    |--  awran5   it works FINALLY...   on October 16, 2013, 4:00 pm
    |--  valley   Sir please make...   on October 17, 2013, 5:37 am
    |--  awran5   Thank you, But...   on October 18, 2013, 1:36 am

« Previous    Next »

Normal Mode | Print  



Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is May 2, 2025, 2:51 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:0.030