If I use Lighttpd as webserver, how can I use caching plugin like w3 total cache or wp super cache? Need your help for configuring lighttpd.


closed as off-topic by birgire, Johannes Pille, mrwweb, Pieter Goosen, Nicolai Aug 27 '14 at 7:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – birgire, Johannes Pille, mrwweb, Pieter Goosen, Nicolai
If this question can be reworded to fit the rules in the help center, please edit the question.


The following script takes the url that was asked from the client. It checks whether there is a fresh version of a static HTML page on the cache and if yes, it servers that. If the file does not exist at all or the it is expired(I check its modification date) then the request is forwarded to the PHP fcgi so that it can be freshly served.

This is for Wp Super Cache.

  1. Download the latest version of the rewrite.lua script from this github project site.

  2. Place rewrite.lua in the root directory of your WordPress installation, i.e., the same directory where you find the WordPress PHP files such as wp-config.php.

  3. Update your lighttpd config file for the host running WordPress and include this command: magnet.attract-physical-path-to = ( server.document-root + "/rewrite.lua" )

  4. Make sure the Mobile device support option of the WP Super Cache plugin is enabled and the Rejected User Agents list is up-to-date. You’ll find those options in the Settings -> WP Super Cache menu of WordPress once WP Super Cache has been activated.

The lighttpd host configuration should now look somewhat similar to this:

$HTTP["host"] == "myblog.com" {
  server.document-root = “/srv/www/myblog/wordpress”
  accesslog.filename = “/var/log/lighttpd/myblog/access.log"
  magnet.attract-physical-path-to = ( server.document-root + “/rewrite.lua” )

Nginx has better support. http://wiki.nginx.org, http://wiki.nginx.org/Wordpress

The WP Super Cache plugin developer has the Nginx rewrite rules for his plugin on his blog: http://ocaoimh.ie/2009/11/23/wordpress-nginx-wp-super-cache/

  • I couldn't agree more! just the facts that wordpress.com uses Nginx is strong enough to use it! – Pontus Abrahamsson Jun 12 '12 at 12:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.