fix: Rebuild cache in background (#17487)

diff --git a/erpnext/portal/product_configurator/item_variants_cache.py b/erpnext/portal/product_configurator/item_variants_cache.py
index 39f0803..0e0b8c9 100644
--- a/erpnext/portal/product_configurator/item_variants_cache.py
+++ b/erpnext/portal/product_configurator/item_variants_cache.py
@@ -97,6 +97,10 @@
 		for key in keys:
 			frappe.cache().hdel(key, self.item_code)
 
+	def rebuild_cache(self):
+		self.clear_cache()
+		enqueue_build_cache(self.item_code)
+
 
 def build_cache(item_code):
 	frappe.cache().hset('item_cache_build_in_progress', item_code, 1)
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index ed02cee..3e501b4 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -964,7 +964,7 @@
 
 	if item_code:
 		item_cache = ItemVariantsCacheManager(item_code)
-		item_cache.clear_cache()
+		item_cache.rebuild_cache()
 
 
 def check_stock_uom_with_bin(item, stock_uom):