Howdy,

Within many CMS platforms there are native or add on caching that turn
dynamically generated content in to static files.  Cherokee is able at
serving these files up more efficiently that firing up an interpreter on
each page load.  However I am a bit stuck on how to configure Behaviors to
handle this.

The example I am working with is Wordpress with the WP SuperCache plugin.
 This generates name relative HTML files to the URL linked in all WP
posts/pages/etc.

URL: http://example.com/some-category/my-new-post
Creates: /wp-content/cache/supercache/
example.com/some-category/my-new-post/index.html

The Apache rule for this looks like:

RewriteCond
%{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html"
[L]


Following that logic the behaviors would need to:
-Run a regex/redir on the URI to transform with the root/cache dir +
index.html
-Test if file exists:
> Yes - serve static file
> No - hand off to the rest of the PHP rules/regexs for Wordpress

The 'No' part is what seems tricky.  If the URI has been transformed would I
need another redirect to un-transform it?  Is that needlessly expensive to
flip the URI back and forth with regular expressions or cause a single
request to have to loop through the Behaviour list multiple times?  Any
assistance in duplicating the functionality of the above Apache mod_rewrite
rule is appreciated.

Thanks!

PS. I also understand that the new Front Line Cache would be equally suited
to handle this in front of the PHP Information Source.  Due to its beta
status and lack of means to invalidate from the CMS I am putting it out of
consideration.
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to