I'm working on a wholesale site that means I have at least 15 unique add_to_cart forms on a product listing page. This slows the page down considerably as each form is dynamically generated. I've been experimenting with ce_cache and if I cache the whole listing the site is so much faster - the only thing I'm concerned about is what I'm sacrificing in terms of dynamic information, and any risks I might incur by caching these listings.

The speed improvement is so significant that it would be great to be able to do this.

Also, the actual site is pretty straightforward - there are no inventory counts to look up, so it won't make any difference there. It seems to work for me, but I don't want to push it to production if I run the risk of anything happening to customer orders as a result of the caching.

If anyone has any experience of this, or knows more about what impact this may or may not have I'd love to hear about it!

1 Answer 1


You should never cache things that are this dynamic. CodeIgniter adds an XID to forms which can cause validation errors if they're reused. What you could consider is dynamically loading them, sort of like this:

var items = $('.products .product');

$.each(items, function(){

    var url = $(this).attr('data-form-url');


  • 1
    I'm already using some automatic pagination to ease the page-load pain (ie loading more 'under the fold'). This is interesting though as I could be displaying the product and loading the forms in the background. Hmm. Food for thought, thanks Steven! Commented Sep 3, 2013 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.