Exclude Cart Block from Cache

Posts: 32
Joined: 09/28/2007

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

Posts: 88
Joined: 11/06/2007
Bug FinderGetting busy with the Ubercode.

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.

Posts: 32
Joined: 09/28/2007

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

Posts: 32
Joined: 09/28/2007

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

txcrew

Posts: 797
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

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

--

<tr>.

Posts: 1123
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

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?

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 32
Joined: 09/28/2007

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

Posts: 4254
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

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