How to handle frequent ajax requests in shopping cart

Is it common and/or acceptable to have Ajax requests every time a button is clicked on a shopping cart page? This is not a high traffic site. It will only have a few users at a time, like 5 max. I’m calling it a shopping cart for lack of a better term. The site is intended to let customers create highly customized orders, which benefits from logic being on the server instead of on the client.

I have many questions regarding the best practices in this sort of design. Like, should I block user input until the ajax request is received? Should I be sure to display an error message if the ajax request fails? Should I automatically repeat the ajax request if it fails? Are there any other considerations?

1

It looks like you are interested in best practices to follow or just use in your case.
There are a number of written article on this subject matter, however there are few good once that combine techniques in one as well 🙂

Regarding your questions, i would skip the one saying “Should I automatically repeat the Ajax request if it fails?” – No, just process the failure message in user friendly way.

More readings on best practices with Ajax calls:

  • THE PERFECT JQUERY AJAX REQUEST
  • 24 Best Practices for AJAX Implementations
  • Ajax Best Practices: Reduce and Aggregate similar XHR calls

4

should I block user input until the ajax request is received?

Only if user actions should be blocked. For example, if you’re updating the cart total there is no need to block. But if the user is removing an item from the cart, you probably need to complete processing and recalculate before allowing them to manipulate something else in the cart. To put it simply, only block user input when necessary but be sure to consider every situation where it is really necessary.

Should I be sure to display an error message if the ajax request fails?

If it will matter to the user then yes, display a user-friendly message. For example, if removing an item from the cart fails, the user will not see their action succeed, or may see incorrect information. That must be handled correctly with the user. Be sure the backend properly logs the error so by the time the user reports it there’s a solution.

Should I automatically repeat the ajax request if it fails?

Maybe if it fails from a timeout, but otherwise no. No need to repeat something that will likely fail.

Are there any other considerations?

Lots! If you ask more specific questions we can give you more specific answers. In short, I would say think of your AJAX calls just as any other subsystem with architectural, performance, maintenance and user considerations.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật