4 ms·
Pretty much! Caching makes a big difference, especially for first-time visitors. For logged-in users, one particular big gain was getting rid of a join from use
by amk_ 10y ago
Pretty much! Caching makes a big difference, especially for first-time visitors. For logged-in users, one particular big gain was getting rid of a join from users to events to show the notifications count, and replacing that with a counter cache (denormalization).
- dorianm 10y agoBy the way there is counter_culture[1] which is great for more complex counter caches: Inventory: product quantity 1 2 1 5 2 -1 2 3 2 10 And having a counter cache for the sum per product (e.g.: product.inventory_quantity). [1]: https://github.com/magnusvk/counter_culture https://github.com/magnusvk/counter_culture
- amk_ 10y agoThat looks useful, thanks