1

I've got in a custom module created on module/view/frontend/layout/default.xml with:

<block class="\Magento\Framework\View\Element\Template" template="sample:module::sampletemplate.phtml" name="sampleblock" cacheable="false" _isScopePrivate="true"/>

I think that if i put the cacheable="false" to dont let the block to be cached, but it's not working.

How could i could remove cache of this block?

5

In block class set _isScopePrivate property to true on __construct() function.

So add this to your class

public function __construct(){
$this->_isScopePrivate = true;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.