简体   繁体   中英

serve cache/html pages created by wp-super-cache using lighttpd

Currently I have lighttpd configured as a reverse proxy of apache. Lighttpd listens on the public IP while apache listens on 127.0.0.1. Lighttpd passes non-static contents to apache using the configuration

    $HTTP["url"] !~ "\.(js|css|gif|jpg|png|ico|txt|swf|html|htm|gz)$" {
        proxy.server  = ( "" => (
            ( "host" => "127.0.0.1", "port" => 80 )))
        expire.url = ( "/" => "access 5 minutes")
    }

This simple setup works just fine with a vanilla wordpress install. Static files are being served by lighttpd while everything else is served by apache.

I want to take it to the next level so I installed wp-super-cache so that cache/html version of pages are created. The wp-super-cache plugin has been installed properly and its modification to the htacess file has been properly applied. I used the mod_rewrite mode of wp-super-cache and the custom permalink structure of wordpress is /%category%/%postname%.html. All works great. Cache/html pages are being created and served. There is just one little problem. It will only work if I remove the html file extesion in the above configuration. This means apache will serve the cache/html files and not lighttpd. One solution that I thought of is to have simliar rewrite rules on lighttpd when accessing html files. I do not know if it will gonna work but I searched for it anyway. I found http://tempe.st/2008/05/lightning-speed-wordpress-with-lighttpd-and-supercache-part-ii/ (you may need google cache to access it because it was not working today, but yesterday it did) thinking it may be the solution but the bad news is I am using a rpm based distro and the rpm repo that I use does not have mod_magnet for lighttpd. I searched for other repos that offer lighttpd with mod_magnet but found none. So I cannot use the one solution that I have found because my lighttpd does not have mod_magnet functionality.

What should I do to make lighttpd serve the cache/html files that were created by wp-super-cache? Is this possible?

Thanks!

I know, it's a little bit late, but you could try my version of rewrite.lua script for WP Super Cache. It works just like it must work. https://gist.github.com/1258096

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM