Page 1 of 1

Maintain certain dynamic portions on page

PostPosted: July 22nd, 2010, 10:25 am
by newpub
Is there a way to keep certain parts of a page dynamic? For example, in an ad-rotating scenario?

I understand Super Cache can do this via its "mfunc" function, so I'm hoping there's a similar capability in Quick Cache?

Code: Select all
How do I make certain parts of the page stay dynamic?

WP Super Cache retains the dynamic loading code of WP Cache but only works in "half on" mode.

There are two ways to do this, you can have functions that stay dynamic or you can include other files on every page load. To have a dynamic function in the cached PHP page use this syntax around the function:

<!--mfunc function_name( 'parameter', 'another_parameter' ) -->
<?php function_name( 'parameter', 'another_parameter' ) ?>
<!--/mfunc-->


Thanks!

Re: Maintain certain dynamic portions on page

PostPosted: July 23rd, 2010, 12:07 am
by Jason Caldwell
Nope. Not yet. Quick Cache does not support this.
~ I'll log this as a feature request.
Thank you!

Re: Maintain certain dynamic portions on page

PostPosted: July 23rd, 2010, 12:15 am
by newpub
Thanks for getting back to me so quickly.

I'd love to continue using Quick Cache, but being able to keep certain parts of my page dynamic is critical to operations, so I'll have to use another cache... but only temporarily. Once you add in this functionality, I promise to come back! :D

Thank you for doing a great job with the plugin. I really appreciate all the time and effort you're putting into this.

Re: Maintain certain dynamic portions on page

PostPosted: July 23rd, 2010, 12:19 am
by Jason Caldwell
Sure thing. ~ Look for this to come in one form or another in the next release.
~ We'll try to improve upon what Donncha has already done.

Re: Maintain certain dynamic portions on page

PostPosted: December 11th, 2010, 8:16 pm
by latent
First off... I freaking LOVE this plugin. Expect a donation from my day job very soon!

I was experimenting with a work-around for the the dynamic content problem, and ran across something a bit hinky.

This is for an ecommerce project, so I need to cache content for all users regardless of login status.

In a nutshell, my solution is to use old-school Apache SSI via #include virtual / #exec cgi. This way the HTML include comment is what actually gets cached (as opposed to the actual content). These includes point to little php scripts that just boot strap WP and show user status, etc. They are not cached.

All works as expected (fast as snot), EXCEPT.... once the cached file exceeds roughly 8k in size, the include suddenly breaks. The cache file contains all the expected content, and the include comment disappears (like it should), but the included content is simply missing (even though everything after it is intact). I've tested this by manually padding the cached file until it breaks. Neither the Apache or PHP logs are giving me any clue as to what's happening.

That 8k limit doesn't seem like a coincidence, but the only parameter I can find that's even a multiple of that threshold is output_buffering in php.ini. Changing this parameter has no effect.

This really seems like a viable work-around for the dynamic content problem... so long as I can figure out what's going on. Relevant version numbers shown below... any insight would be greatly appreciated.

PHP 5.3.3-1ubuntu9.1
Apache/2.2.16 (Ubuntu)
QC 2.2.7
WP 3.0.3

Re: Maintain certain dynamic portions on page

PostPosted: December 15th, 2010, 12:42 pm
by dozarte
newpub wrote:Is there a way to keep certain parts of a page dynamic? For example, in an ad-rotating scenario?


I think you could use Javascript or Iframes to load external stuff.

Re: Maintain certain dynamic portions on page

PostPosted: April 6th, 2011, 10:49 am
by beachbum
Any progress on this yet?

I would really like to get the "Booking Calendar" widget to be dynamic and not cache.

http://wordpress.org/extend/plugins/booking/

Re: Maintain certain dynamic portions on page

PostPosted: April 6th, 2011, 10:47 pm
by cacheMan
i'm also looking for information on this

in the FAQ's there's the following information, but i haven't been able to get it to work - QC simply doesn't cache anything if i implement it. this is likely due to me not knowing enough about php and putting this code in the wrong place in the plugin files.

I'm a plugin developer. How can I prevent certain files from being cached?
define("QUICK_CACHE_ALLOWED", false);