vladk wrote:I believe everything except for pictures in PrepareProductDetailsPageModel is already cached. If you check all the calls in that method they all use cache
In terms of the underlying service calls, yes they are using the cache - but there's still a lot of code running as you navigate the pages (categories \ product view etc) while it prepares the models.
Anything we can do here in terms of caching to reduce the amount of code running between pages has got to be beneficial.
vladk wrote:I can see image stuff being slow though so it's possible that if some kind of media caching is added the speed will improve at the cost of memory
Yeah, PrepareProductDetailsPageModel calls into GetPicturesByProductId which makes an uncached repository call & loads binary data - would want to avoid this really since all we're after here is the PictureModel which is much lighter. I'd happily sacrifice memory for performance here (I'll have a dedicated machine for this, but maybe not completely viable in hosted instances?)
a.m. wrote:OK, good stuff :)
a.m. wrote:But a model returned from PrepareProductOverviewModel method contains product price for the current customer. A store owner can create some complex discounts based on shipping address, order totals, etc. And a price can depend on them. And this behavior makes caching of calculated product prices impossible (until you don't have discounts)
Ah, didn't notice that - I'm running a proof of concept for a very specific store here that won't have discounts etc, product prices will be static 'across the board' for all customers. Caching will be valid in this case, but yeah you can't do that otherwise.
I'm probably going to branch away from the main development here, since what I'm looking into isn't an ecommerce store per se, but a place that customers in our high street stores can come to redeem loyalty points they've earned for rewards. I still need the functionality of a shopping basket, but there's a lot of extra functionality that will never be relevant in this store.
Thanks again - will make sure the company contributes something if they go with the solution :)