[wp-hackers] how to cache w/ php in WP templates
gaarai at gaarai.com
Wed Feb 18 20:45:21 GMT 2009
I haven't had a large amount of experience with Super Cache, but I do
have a bit.
To my knowledge, you can't have any server-side processing occur with
Super Cache since it merely provides static files. Since these are
static files, the entire WordPress code stack is bypassed and no code at
all is executed.
The way to introduce dynamic elements with Super Cache is with
client-side scripting. To quote the FAQ:
"Other dynamic elements on a page may not update unless they are
language. The plugin really produces static html pages. No PHP is
executed when those pages are served."
David J. Bisset wrote:
> I use wp-super-cache and love it, but it really isn't effective on
> site where i have php code in the header and other templates.
> I can't have some particular php functions "cached" because (for
> example) one php function checks a client-side cookie and outputs html
> based on the value. Cache that, and the same html will be output
> Once upon a time, wp-cache had functions you could surround php
> functions to NOT cache them. I get the impression that is no longer
> possible. Can anyone here confirm and if it's true provide an
> alternate solution (with or without wp-super-cache)?
> Oh, and if anyone is going to Wordcamp Miami this Sunday hit me up on
> Twitter! :)
> Thanks in advance.
More information about the wp-hackers