Lighttpd, WordPress Caching plugin [closed]

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” )
}

Leave a Comment