Are you familiar yet with this usability issue that caching and anonymous cart blocks don't play well together?!
http://www.ubercart.org/forum/support/15908/boost_module_and_shopping_ca...
After reading up on it for a while, I realized why it is so difficult: cached pages are static, that's why they can be cached. They are the same for anyone. If you build dynamic pages they are just not static anymore. There is that issue that partial caching is not really a feature of D6, but it's coming in D7 (I'm thinking of Pressflow)! Doesn't help Ubercart users though.
There is one solution which takes the Ubercart Ajax Cart Block, but that is not satisfactory for me. Firstly, because it doesn't play well with the Out Of Stock module, and secondly it doesn't make sense to me to make an ajax call on every page for the cart contents, as it is kinda just like sending two pages on every request of which one is even dynamic! Not acceptable to me, because I want true caching!
So at first it seems there is no real solution, and anonymous are left with a secretive cart block (which might say something like: please login to see your cart contents on every page). I'd rather have no cart block than a cart block that doesn't give the user any useful information...
But then I suddenly had an idea. All that I need is for anonymous users to see how many items they have in their cart, even if they are on a cached page. So all I need really is a cart counter, not a detailed inside view.
I'd really like to use Boost caching and this is the single piece of information that I don't want to be static (it's less bytes than a txt message!). I would actually love to have static boost-cached pages that simply grab the number of items in the anonymous user's cart from an individual mini-cache that is user-specific, stored in their browser, along with their identifier: a cookie!
Cookies can hold up to 4000 characters, so I'd imagine that somewhere in a cookie that drupal and/or ubercart is using, there would be some room for an additional 100 characters somewhere, right? What I am assuming is that boost-cached pages could potentially print a cookie-stored value in the pages they serve... Do you think I am wrong, please teach me, I want to learn more about cookies!
Then, in addition to boost-cached pages being able to read a cookie-stored value, this cookie would need to be written and updated somehow, like everytime a user adds something to the cart, the cart contents should be re-counted and re-set. The same is true when the cart contents get updated or even emptied. And Expiration should of course be equal to the anonymous cart content session in the database.
Does this sound like something you could do? I would be happy to pay you for it! Please post a quote of how much you'd like to get for it. You can get as many free hugs as you'd like on top of that! A contrib module for this would be grand! But I also don't mind to hack in the Ubercart code...
Kind Regards, Michael


