[wp-hackers] how to cache w/ php in WP templates

Donncha O Caoimh donncha at linux.ie
Thu Feb 19 16:21:20 GMT 2009


That old mfunc code is still there but I haven't documented it's use. 
You'd have to switch to half-on mode, and disable compression for it to 
work. Probably. I haven't tried it though. Look in wp-cache-phase2.php 
for "mfunc".

If the dynamic output is based on a cookie then you might as well use 
Javascript to fill in the details. That's what I would do and you'd have 
all the advantages of the static html cache file.

Donncha

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 
> regardless.
> 
> 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.
> 

-- 
Donncha O Caoimh
http://ocaoimh.ie / http://inphotos.org / http://wordpress.com



More information about the wp-hackers mailing list