Page 1 of 1

Posts are not cached, but pages are

PostPosted: September 6th, 2010, 7:35 pm
by jacinta
Hi there,
I first installed & turned on Quick Cache with the default settings, and then I added some settings like the google xml sitemap url and turned on debugging... but still the posts are not cached (or at least the source does not show the Quick Cache Report). I have the plugin wp-include calling a php file from the post content. I made a plain text/html post to test if the wp-include file was stopping it, but it still did not cache the post. Strangely all pages are cached ok. Plugins I have installed are eShop, Exec-php, Contact form7, Mailchimp, wp-cms post control (to stop revisions), wp-table reloaded, events calendar and various category plugins, If anyone can look at an example post, I'd be grateful, eg. http://ibooknewzealand.com/2010/all-new ... -ultimate/
Regards, Jacinta.

Re: Posts are not cached, but pages are

PostPosted: September 7th, 2010, 3:38 pm
by Jason Caldwell
Hi Jacinta. Here are some things I would have a look at:

1. Are you logged into the site?
( Quick Cache does not serve cached pages to logged-in users )

2. Did you recently leave a comment on your site?
( Quick Cache considers a recent commenter, as a logged-in user )

3. Are you hosted by GoDaddy? If so, please take a look at this thread:
viewtopic.php?f=5&t=168&p=1700&hilit=godaddy#p1619

Re: Posts are not cached, but pages are

PostPosted: September 7th, 2010, 8:54 pm
by jacinta
Thanks Jason, however the answer is no to all of the above. I am well aware of the no-cache for logged users. Is there any other info I can give you?

Re: Posts are not cached, but pages are

PostPosted: September 7th, 2010, 9:37 pm
by jacinta
Through a process of elimination I've found that Quick Cache works with this code:
`<?php echo do_shortcode( '[contact-form 1 "Contact form 1"]' ); ?>`
but it does not work with this code:
`<?php echo do_shortcode('[eshop_addtocart]'); ?>`
Both reference a database table so I'm not sure why the incompatibility.
This page does not have the eShop cart code:
http://ibooknewzealand.com/2010/rotorua-thermals/
Whilst every other post does have it and is not being cached.
Any thoughts Jason ?

Re: Posts are not cached, but pages are

PostPosted: September 8th, 2010, 12:40 am
by Jason Caldwell
Gotchya. Thanks for the additional details.
~ Much appreciated.

Inside the /eshop/cart-functions.php file, I find this:
Code: Select all
if (!function_exists('eshop_cache')) {
    function eshop_cache(){
        global $eshopoptions;
          if(!defined('DONOTCACHEPAGE') && $eshopoptions['set_cacheability']=='yes'){
              //wpsupercache
            define("DONOTCACHEPAGE", "true");
        }
    }
}
 

In other words, this particular plugin ( based on your configuration ) could be telling Quick Cache that it should NOT cache the page, and it is most likely doing this for a good reason ( i.e. perhaps it's not compatible with caching plugins under certain circumstances? ).

It also looks like this is a configurable eShop option. So you might take a look in your Dashboard and/or in their forums to see what the implications of disabling this are.

Please report back if this helps, doesn't help?

Re: Posts are not cached, but pages are

PostPosted: September 8th, 2010, 8:27 pm
by jacinta
Ah got it - you're right about the setting for eshop which I'd set to "Yes, cache all pages with checkouts & shortcodes". Of course you want the checkout pages not cached, but I used a specific shortcode on each post (as above), so I have now disabled the function in eshop and all the posts are now cached. If anyone has the same situation, the code is below (eshop_shortcodes.php). Thanks a million Jason - really proves that 2 heads are better than 1 ! - Mark this as closed.
Code: Select all
`function eshop_addtocart($atts){global $wpdb, $post;
/*DELETED THIS LINE SO THAT PAGES WOULD BE CACHED   eshop_cache();*/
   extract(shortcode_atts(array('hide'=>''), $atts));`

Re: Posts are not cached, but pages are

PostPosted: September 28th, 2010, 12:08 pm
by Jason Caldwell
@Resolved.
Thanks for reporting back on this.