darryldecode / laravelshoppingcart

Shopping Cart Implementation for Laravel Framework
1.32k stars 413 forks source link

Draft: added cached content and cached conditions to improve performance #365

Open Biostate opened 1 year ago

Biostate commented 1 year ago

Problem: If you using database storage, getContent or getConditions methods always runs query to get data from database. For example if you call getTotal and getSubTotal methods they call getContent method twice and this will runs 2 same query on database.

Solution: define cachedContent and cachedConditions variable in Cart.php