elgentos / LargeConfigProducts

Large Configurable Products workaround for Magento 2
91 stars 28 forks source link

Changes in configurable products only visible after redis-cache flushall. #50

Closed SebTechDevelopment closed 2 years ago

SebTechDevelopment commented 2 years ago

We noticed a problem with one of our clients. After editing a configurable product (Updating image, productname); the changes were not visible in the frontend. Only after we manually ran FLUSHALL on redis, our changes got displayed. I did notice the ProductSaveAfter function, but this function does a reindex. Would it be an idea to add an option to flush the product specific redis-cache flush after a ProductSaveAfter?

Magento version: 2.4.2-p1 Plugin version: 0.4.0

gaiterjones commented 2 years ago

When you save a configurable product the module automatically refreshes the lcp product data redis cache (prewarm) for the product using Magento message queues. This is triggered by the "index" process in the ProductSaveAfter observer.

If you flush the redis cache you are erasing the lcp cache for all products which I think is a bad idea.

I have experienced no problems using the module with Magento 2.4.2-p1 and 2.4.3-p1 and I am using an external rabbit mq consumer for the lcp message queues so I can clearly see in the consumer logs the prewarm cache process running after I save a product.

I would suggest adding some extra logs to Elgentos\LargeConfigProducts\Model\MessageQueues\Consumer::ProcessMessage() around line 86 to log some extra info to check that your message queues are being processed correctly.

I guess your problem lies with your RabbitMQ / Magento message queue setup.