11 replies [Last post]
txcrew's picture
Offline
Joined: 09/28/2007
Juice: 103
Was this information Helpful?

How would one go about doing this? I looked into the Drupal API docs and found http://api.drupal.org/api/constant/BLOCK_NO_CACHE/6

which basically says to use something like

<?php
define
('BLOCK_NO_CACHE', -1);
?>

in your module. Would I have to hack the ubercart core to do this? Is there a better way?

TIA,
txcrew

greenSkin's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/06/2007
Juice: 263
Re: Exclude Cart Block from Cache

That is for Drupal 6. Blocks in Drupal 5 do not get cached, unless you install the Block Cache module and then enable the cached version of a block.

txcrew's picture
Offline
Joined: 09/28/2007
Juice: 103
Re: Re: Exclude Cart Block from Cache

I am using Drupal 5.7 but for some reason, I am showing that the block is cached. When the sites cache is enabled I am getting and I am browsing the store as an anon user and adding products to my cart, the cart block will show that I have products in my cart on certain pages while on other pages my cart block is empty.

Perhaps it is by my browser cache?? But why would it work just fine when the cache for the site is disabled?

txcrew

txcrew's picture
Offline
Joined: 09/28/2007
Juice: 103
Re: Re: Re: Exclude Cart Block from Cache

Does this really not happen to anyone else? Does anyone use the Drupal Cache with their store?

txcrew

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Re: Re: Re: Exclude Cart Block from Cache

What version of Ubercart are you running? This was a problem once, but was fixed many versions ago.

<tr>.
torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: Re: Re: Exclude Cart Block from Cache

I use "normal" caching on our site and haven't seen anything like this. Do you have other cache modules enabled? Or anything server-side like APC or memcached?

--
Help directly fund development: Donate via PayPal!

txcrew's picture
Offline
Joined: 09/28/2007
Juice: 103
TR wrote:What version of
TR wrote:

What version of Ubercart are you running? This was a problem once, but was fixed many versions ago.

Ubercart 5.x-1.0-rc2

Drupal 5.7
MySQL database 4.1.22
PHP 5.2.2
Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b

torgosPizza wrote:

I use "normal" caching on our site and haven't seen anything like this. Do you have other cache modules enabled? Or anything server-side like APC or memcached?

No other cache modules enabled. Just using the normal cache settings and I have Aggregate and compress CSS files ENABLED. I'm not sure if there is anything additional server side. I'm on a shared server running on Hostgator, I could double check and make sure there is nothing else.

Any other ideas?

txcrew

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: TR wrote:What version of

To be honest, I've seen this problem here and there and tried to address it in various ways, but I never really could reproduce it or strike gold on an across-the-board fix. If you hit on something, please let us know... somehow blocks do get cached along with the whole page for anonymous users, but it just doesn't seem to happen to everyone. Puzzled

netslave's picture
Offline
Joined: 05/22/2008
Juice: 187
Block Caching

We have the same problem on our production site.

- No other cache modules are activated / installed
- Cache setting is "normal"
- All sites "cart" "checkout" and so on , are excluded from cache ( with cache exclude module ). But cart block was still on other pages cached.

Costumers see cart items from a costumer before.

Solution was to disable cache.

netslave's picture
Offline
Joined: 05/22/2008
Juice: 187
About page cache

Ok i read a little bit.

The problem is really cache. Because if you have your cache settings on "normal" complete pages are cached. So you can't exclude one block from caching.

This means, you must disable cache. Are you will have problems with cart block. Only chance to avoid this problem, make cart complete ajaxable ;- ). So all block cart content are not cached ( exclude block ajax call path from cache ! ).

I will add a new option to my module ( http://www.ubercart.org/contrib/6148 ) to load cart onload from ajax call. I will try this and give some feedback.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: About page cache

I just wanted to link to a related discussion in the issue tracker on d.o: http://drupal.org/node/309394

make-online-shop's picture
Offline
Joined: 01/01/2011
Juice: 217
Still now way to exclude a block from cache ?

Hello,

Still now way to exclude a block from cache ?

I am using AJAX CART and it is not updated when customers add products or remove them.

Thanks.