Although I don't think this is a particularly tricky question, it makes more sense for me to pay someone than to figure it out myself. If you can provide me with the code to get this working, I'll send you $20 via PayPal. Here's the deal:
My site chunkybling.com has an Ajax Cart block in the upper-right corner of all pages. I'd like to implement the Boost module with static page caching. However, this has the unfortunate side effect of creating cart ghosting--where one customer's cart contents are cached and displayed to the next customer. I'd like to know if there is a way to make my Ajax Cart fire an update after each page load so that the cached cart contents are immediately replaced by the actual cart contents.
Specifically, I need someone to provide me with the javascript code snippet and tell me where to put it. Thanks!
Comments
First off, are you sure you
First off, are you sure you want to do this? Creating static pages will deny you the ability to work with sessions in exactly the way that's important for an e-store. AJAX calls would compensate for that but what happens when JS is turned off?
Triggering the cart update would be as simple as a small JS snippet but I'd urge you to reconsider your options. Do you really get that much traffic that you need static caching? I'd say use js to employ some AJAX product loading and other functionality to reduce the number of page loads in total, and also make it nicer for the user (quicker) to get around your site. Then, when JS is turned off, the penalty will just be that they have to wait for a page to load like normal.
Feel free to contact me to discuss some options. I generally get quite excited about increasing user experience and site usability through AJAX.
My site is pretty bloated
My site is pretty bloated with modules. Therefore, each page call takes around 1500ms. With static pages via Boost I can get this down to around 250ms. So it significantly improved the user experience. Other than the cart, I'm not sure what functionality I stand to lose from choosing not to work with sessions. Perhaps you can explain further. I'm not opposed to the Ajax approach, but the static page approach seems the faster route--assuming I can get the cart issue worked out.
It's a sad day when drupal
It's a sad day when drupal can't even run an simple e-store isn't it? I wouldn't be satisfied with that page load time either, but you shouldn't have to resort to static caching to get around it (in the real world at least).
Thanks for commiserating. I
Thanks for commiserating. I really don't have a problem with static page caching. With Boost's ability to auto-refresh the page cache at a pre-set time (e.g. 2AM every morning), this seems to me the ideal solution for driving down response times for page requests. If I had a lot of dynamic content, things would be different. The only hitch for me is how to track the session for the ajax cart. If I can figure that out, I'm golden!
AJAX Cart
If your serious I could probably get this going for you, but this is way more complicated then it looks. It's worth a lot more then $20 bucks (in development costs), since you need to keep track of the customer & return that cart to them, all from a static html file via javascript. What cart are you using and do you need boost? Also be aware that non javascript people will get no cart, and security issues might arise.
Request for Proposal
Hey Mikey,
I didn't realize this would be quite so complex. But I see that you've done a ton of Boost development, and therefore must know what you're talking about. I really don't have a development budget (this is a very mom and pop business) but might be interested if it doesn't cost too much. Let's take this offline. Can you shoot me an email with a quick description of your approach to this problem and the fees? My email is douglas.a.hatch@gmail.com.
I'm using uc_ajax_cart. I'd like to use Boost, as it seems to be the best caching module out there. But I'd consider using a different caching module if necessary.
Thanks,
Doug