Support » Plugin: W3 Total Cache » [Plugin: W3 Total Cache] NGINX support

Viewing 10 replies - 1 through 10 (of 10 total)
  • I’ve tested it out on a DreamHost PS using ngnix and Xcache, and it works just fine, at least based on speed improvements and the footer info on pages.

    If you’re using disk based caching instead of an opcode solution like Xcache, it’s simply a matter or changing one line in the SuperCache nginx instructions (lines 23-49 in that post). Just change line 40, so it reads:

    `set $supercache_file /wp-content/w3tc/pgcache/$1/_index.html;

    Your rewrite rule now matches the directory structure under which the cached files are created with W3 Total Cache.

    Works for me but Im completely APC, so no need to do any rule rewrites.

    Plugin Author Frederick Townes

    (@fredericktownes)

    Every implementation of nginx rules I’ve ever seen is complete. Please keep in mind that you will get erratic behavior until nginx is officially supported.

    Im using APC, which I believe doesnt need mod rewrite rules. I cant take advantage of browser caching though since I dont want to mess around too much with the Virtual host commands… I rather wait for version 1…

    Plugin Author Frederick Townes

    (@fredericktownes)

    Sorry I meant to say “incomplete” earlier. Anyway, you’re all set for now then if you’re using APC (except for browser cache obviously).

    @braddor

    You can take advantage of browser caching my adding expires max; to your server file making sure to only apply it to images, css or js by adding this to your server file:

    server {
            listen 80;
    
            server_name  www.xxxxxxx.com xxxxxxxxx.com;
            access_log  /var/log/nginx/xxxxxxx.proxied.log;
    
            # Serve directly:  /images/ + /css/ + /js/
            #
            location ^~ /(images|css|js) {
                    root   /srv/www/xxxxxxxx/public_html/;
                    access_log  /var/log/nginx/xxxxxx.direct.log ;
    expires     max;
            }
            # Serve directly: *.js, *.css, *.rdf,, *.xml, *.ico, & etc
            #
            location ~* \.(js|css|rdf|xml|ico|txt|gif|jpg|png|jpeg)$ {
                    root   /srv/www/xxxxxxxx.com/public_html/;
                    access_log  /var/log/nginx/xxxxxxxx.direct.log ;
    
    expires     max;
            }

    This would be added before your PHP directives.

    Also take a look at the Nginx Compatability plugin. I have used it in conjunction with W3-Total cache and there are no conflicts. The other option is to use nginx as a front end proxy to serve static files and pass everything else to Apache.

    Thanks c3mdigital. My server is pure NGINX though….i decided to ditch apache (using php-fpm). I should still be fine though right?

    Plugin Author Frederick Townes

    (@fredericktownes)

    Right @c3mdigital ? 🙂

    @braddor

    If your using Nginx on its own the plugin will make WordPress think you have mod_rewrite enabled and allow you to use pretty permalinks.

    There is a sample server config file included with the plugin and a very good article on using Nginx with php-fpm and Apc here:

    http://interfacelab.com/nginx-php-fpm-apc-awesome/

    Plugin Author Frederick Townes

    (@fredericktownes)

    Formal nginx support is currently scheduled for 0.9.5 release.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: W3 Total Cache] NGINX support’ is closed to new replies.