1

I need some help to understanding Magento cache So Idea is that I want to refresh cache of specific category page (not all category pages) on an interval. How can i do that in Magento 2?

1 Answer 1

0

Something like below can help.

$categoryId = 'you-cat-id'; $category = $objectManager->create(\Magento\Catalog\Model\Category::class)->load($categoryId); $category->setIsChanged(true); $category->save(); 

This forces Magento to consider the category as changed and triggers the necessary cache refresh for it. I haven't tried it. But you can check though.

And of-course do not use object-manager directly.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.