Caching does not bring much:
- In my test it takes less than 15 ms to recalculate the page list.
- The progress block is supposed to be displayed only on checkout pages, which usually take a little percentage of whole page views.
Caching has a big problem: it is not context-aware. For example, the pages are languague-dependent (fixed in #1376526: Caching of commerce_checkout_pages is not localization-aware), and could be role-dependant, product-dependant... (pages list is change in hook_commerce_checkout_page_info_alter() which is not cached). Of course this can be fixed in every hook_commerce_checkout_page_info_alter implementation with something like:
if (module_exists('commerce_checkout_progress')) {
commerce_checkout_progress_get_items(TRUE);
}
And this is a pain for contrib modules. So I propose that we remove caching.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 1471552.5-commerce_checkout_progress-remove-cache.patch | 6.13 KB | mrfelton |
Comments
Comment #1
jcisio commentedThe above method does not work, neither, needs this (before this issue is fixed):
Comment #2
jcisio commentedEven the whole block should not be cached. Different roles may have different checkout pages (e.g. an registration step for anonymous user).
If the maintainers are ok with those ideas, I'll submit a patch.
Comment #3
webmasterkai commentedA patch would be great. Thanks.
Comment #4
mrfelton commentedI found myself having to flush the cache all the time in order to have checkout pages that are optional, and where inclusion is dynamically calculated based on properties of the order.
Comment #5
mrfelton commentedHere is a patch that removes all caching.
Comment #6
jcisio commentedThe patch looks good, and it is exactly what I thought.
Comment #7
jcisio commented