@@ -206,26 +206,15 @@ public ModelCacheEventConsumer(CatalogSettings catalogSettings)
206206 public const string MANUFACTURER_HAS_FEATURED_PRODUCTS_PATTERN_KEY_BY_ID = "Nop.pres.manufacturer.hasfeaturedproducts-{0}-" ;
207207
208208 /// <summary>
209- /// Key for CategoryNavigationModel caching
209+ /// Key for list of CategorySimpleModel caching
210210 /// </summary>
211211 /// <remarks>
212212 /// {0} : language id
213213 /// {1} : comma separated list of customer roles
214214 /// {2} : current store ID
215215 /// </remarks>
216- public const string CATEGORY_NAVIGATION_MODEL_KEY = "Nop.pres.category.navigation-{0}-{1}-{2}" ;
217- public const string CATEGORY_NAVIGATION_PATTERN_KEY = "Nop.pres.category.navigation" ;
218-
219- /// <summary>
220- /// Key for TopMenuModel caching
221- /// </summary>
222- /// <remarks>
223- /// {0} : language id
224- /// {1} : comma separated list of customer roles
225- /// {2} : current store ID
226- /// </remarks>
227- public const string CATEGORY_MENU_MODEL_KEY = "Nop.pres.category.menu-{0}-{1}-{2}" ;
228- public const string CATEGORY_MENU_PATTERN_KEY = "Nop.pres.category.menu" ;
216+ public const string CATEGORY_ALL_MODEL_KEY = "Nop.pres.category.all-{0}-{1}-{2}" ;
217+ public const string CATEGORY_ALL_PATTERN_KEY = "Nop.pres.category.all" ;
229218
230219 /// <summary>
231220 /// Key for caching
@@ -794,7 +783,7 @@ public void HandleEvent(EntityInserted<Language> eventMessage)
794783 _cacheManager . RemoveByPattern ( SPECS_FILTER_PATTERN_KEY ) ;
795784 _cacheManager . RemoveByPattern ( TOPIC_PATTERN_KEY ) ;
796785 _cacheManager . RemoveByPattern ( PRODUCT_BREADCRUMB_PATTERN_KEY ) ;
797- _cacheManager . RemoveByPattern ( CATEGORY_NAVIGATION_PATTERN_KEY ) ;
786+ _cacheManager . RemoveByPattern ( CATEGORY_ALL_PATTERN_KEY ) ;
798787 _cacheManager . RemoveByPattern ( PRODUCT_MANUFACTURERS_PATTERN_KEY ) ;
799788 _cacheManager . RemoveByPattern ( STATEPROVINCES_PATTERN_KEY ) ;
800789 _cacheManager . RemoveByPattern ( AVAILABLE_LANGUAGES_PATTERN_KEY ) ;
@@ -809,7 +798,7 @@ public void HandleEvent(EntityUpdated<Language> eventMessage)
809798 _cacheManager . RemoveByPattern ( SPECS_FILTER_PATTERN_KEY ) ;
810799 _cacheManager . RemoveByPattern ( TOPIC_PATTERN_KEY ) ;
811800 _cacheManager . RemoveByPattern ( PRODUCT_BREADCRUMB_PATTERN_KEY ) ;
812- _cacheManager . RemoveByPattern ( CATEGORY_NAVIGATION_PATTERN_KEY ) ;
801+ _cacheManager . RemoveByPattern ( CATEGORY_ALL_PATTERN_KEY ) ;
813802 _cacheManager . RemoveByPattern ( PRODUCT_MANUFACTURERS_PATTERN_KEY ) ;
814803 _cacheManager . RemoveByPattern ( STATEPROVINCES_PATTERN_KEY ) ;
815804 _cacheManager . RemoveByPattern ( AVAILABLE_LANGUAGES_PATTERN_KEY ) ;
@@ -824,7 +813,7 @@ public void HandleEvent(EntityDeleted<Language> eventMessage)
824813 _cacheManager . RemoveByPattern ( SPECS_FILTER_PATTERN_KEY ) ;
825814 _cacheManager . RemoveByPattern ( TOPIC_PATTERN_KEY ) ;
826815 _cacheManager . RemoveByPattern ( PRODUCT_BREADCRUMB_PATTERN_KEY ) ;
827- _cacheManager . RemoveByPattern ( CATEGORY_NAVIGATION_PATTERN_KEY ) ;
816+ _cacheManager . RemoveByPattern ( CATEGORY_ALL_PATTERN_KEY ) ;
828817 _cacheManager . RemoveByPattern ( PRODUCT_MANUFACTURERS_PATTERN_KEY ) ;
829818 _cacheManager . RemoveByPattern ( STATEPROVINCES_PATTERN_KEY ) ;
830819 _cacheManager . RemoveByPattern ( AVAILABLE_LANGUAGES_PATTERN_KEY ) ;
@@ -851,8 +840,7 @@ public void HandleEvent(EntityUpdated<Setting> eventMessage)
851840 _cacheManager . RemoveByPattern ( PRODUCTTAG_POPULAR_PATTERN_KEY ) ; //depends on CatalogSettings.NumberOfProductTags
852841 _cacheManager . RemoveByPattern ( MANUFACTURER_NAVIGATION_PATTERN_KEY ) ; //depends on CatalogSettings.ManufacturersBlockItemsToDisplay
853842 _cacheManager . RemoveByPattern ( VENDOR_NAVIGATION_PATTERN_KEY ) ; //depends on VendorSettings.VendorBlockItemsToDisplay
854- _cacheManager . RemoveByPattern ( CATEGORY_NAVIGATION_PATTERN_KEY ) ; //depends on CatalogSettings.ShowCategoryProductNumber and CatalogSettings.ShowCategoryProductNumberIncludingSubcategories
855- _cacheManager . RemoveByPattern ( CATEGORY_MENU_PATTERN_KEY ) ; //depends on CatalogSettings.ShowCategoryProductNumber and CatalogSettings.ShowCategoryProductNumberIncludingSubcategories
843+ _cacheManager . RemoveByPattern ( CATEGORY_ALL_PATTERN_KEY ) ; //depends on CatalogSettings.ShowCategoryProductNumber and CatalogSettings.ShowCategoryProductNumberIncludingSubcategories
856844 _cacheManager . RemoveByPattern ( CATEGORY_NUMBER_OF_PRODUCTS_PATTERN_KEY ) ; //depends on CatalogSettings.ShowCategoryProductNumberIncludingSubcategories
857845 _cacheManager . RemoveByPattern ( HOMEPAGE_BESTSELLERS_IDS_PATTERN_KEY ) ; //depends on CatalogSettings.NumberOfBestsellersOnHomepage
858846 _cacheManager . RemoveByPattern ( PRODUCTS_ALSO_PURCHASED_IDS_PATTERN_KEY ) ; //depends on CatalogSettings.ProductsAlsoPurchasedNumber
@@ -921,8 +909,7 @@ public void HandleEvent(EntityDeleted<ProductManufacturer> eventMessage)
921909 public void HandleEvent ( EntityInserted < Category > eventMessage )
922910 {
923911 _cacheManager . RemoveByPattern ( SEARCH_CATEGORIES_PATTERN_KEY ) ;
924- _cacheManager . RemoveByPattern ( CATEGORY_NAVIGATION_PATTERN_KEY ) ;
925- _cacheManager . RemoveByPattern ( CATEGORY_MENU_PATTERN_KEY ) ;
912+ _cacheManager . RemoveByPattern ( CATEGORY_ALL_PATTERN_KEY ) ;
926913 _cacheManager . RemoveByPattern ( CATEGORY_CHILD_IDENTIFIERS_PATTERN_KEY ) ;
927914 _cacheManager . RemoveByPattern ( CATEGORY_SUBCATEGORIES_PATTERN_KEY ) ;
928915 _cacheManager . RemoveByPattern ( CATEGORY_HOMEPAGE_PATTERN_KEY ) ;
@@ -932,8 +919,7 @@ public void HandleEvent(EntityUpdated<Category> eventMessage)
932919 {
933920 _cacheManager . RemoveByPattern ( SEARCH_CATEGORIES_PATTERN_KEY ) ;
934921 _cacheManager . RemoveByPattern ( PRODUCT_BREADCRUMB_PATTERN_KEY ) ;
935- _cacheManager . RemoveByPattern ( CATEGORY_NAVIGATION_PATTERN_KEY ) ;
936- _cacheManager . RemoveByPattern ( CATEGORY_MENU_PATTERN_KEY ) ;
922+ _cacheManager . RemoveByPattern ( CATEGORY_ALL_PATTERN_KEY ) ;
937923 _cacheManager . RemoveByPattern ( CATEGORY_CHILD_IDENTIFIERS_PATTERN_KEY ) ;
938924 _cacheManager . RemoveByPattern ( CATEGORY_BREADCRUMB_PATTERN_KEY ) ;
939925 _cacheManager . RemoveByPattern ( CATEGORY_SUBCATEGORIES_PATTERN_KEY ) ;
@@ -945,8 +931,7 @@ public void HandleEvent(EntityDeleted<Category> eventMessage)
945931 {
946932 _cacheManager . RemoveByPattern ( SEARCH_CATEGORIES_PATTERN_KEY ) ;
947933 _cacheManager . RemoveByPattern ( PRODUCT_BREADCRUMB_PATTERN_KEY ) ;
948- _cacheManager . RemoveByPattern ( CATEGORY_NAVIGATION_PATTERN_KEY ) ;
949- _cacheManager . RemoveByPattern ( CATEGORY_MENU_PATTERN_KEY ) ;
934+ _cacheManager . RemoveByPattern ( CATEGORY_ALL_PATTERN_KEY ) ;
950935 _cacheManager . RemoveByPattern ( CATEGORY_CHILD_IDENTIFIERS_PATTERN_KEY ) ;
951936 _cacheManager . RemoveByPattern ( CATEGORY_BREADCRUMB_PATTERN_KEY ) ;
952937 _cacheManager . RemoveByPattern ( CATEGORY_SUBCATEGORIES_PATTERN_KEY ) ;
@@ -962,8 +947,7 @@ public void HandleEvent(EntityInserted<ProductCategory> eventMessage)
962947 {
963948 //depends on CatalogSettings.ShowCategoryProductNumber (when enabled)
964949 //so there's no need to clear this cache in other cases
965- _cacheManager . RemoveByPattern ( CATEGORY_NAVIGATION_PATTERN_KEY ) ;
966- _cacheManager . RemoveByPattern ( CATEGORY_MENU_PATTERN_KEY ) ;
950+ _cacheManager . RemoveByPattern ( CATEGORY_ALL_PATTERN_KEY ) ;
967951 }
968952 _cacheManager . RemoveByPattern ( CATEGORY_NUMBER_OF_PRODUCTS_PATTERN_KEY ) ;
969953 _cacheManager . RemoveByPattern ( string . Format ( CATEGORY_HAS_FEATURED_PRODUCTS_PATTERN_KEY_BY_ID , eventMessage . Entity . CategoryId ) ) ;
@@ -981,8 +965,7 @@ public void HandleEvent(EntityDeleted<ProductCategory> eventMessage)
981965 {
982966 //depends on CatalogSettings.ShowCategoryProductNumber (when enabled)
983967 //so there's no need to clear this cache in other cases
984- _cacheManager . RemoveByPattern ( CATEGORY_NAVIGATION_PATTERN_KEY ) ;
985- _cacheManager . RemoveByPattern ( CATEGORY_MENU_PATTERN_KEY ) ;
968+ _cacheManager . RemoveByPattern ( CATEGORY_ALL_PATTERN_KEY ) ;
986969 }
987970 _cacheManager . RemoveByPattern ( CATEGORY_NUMBER_OF_PRODUCTS_PATTERN_KEY ) ;
988971 _cacheManager . RemoveByPattern ( string . Format ( CATEGORY_HAS_FEATURED_PRODUCTS_PATTERN_KEY_BY_ID , eventMessage . Entity . CategoryId ) ) ;
0 commit comments