GordonLesti / Lesti_Fpc

Simple Magento Fullpagecache
https://gordonlesti.com/lesti-fpc-documentationversion-1-4-5/
Other
358 stars 159 forks source link

Clearing custom blocks #305

Closed mortenjakobsen closed 6 years ago

mortenjakobsen commented 6 years ago

Is there a way to clear a custom block ?

It seems it's possible to clear products cache like this:

// Clears all products
$this->_getFpc->clean(sha1('product'));

// Clears product id 2
$this->_getFpc->clean(sha1('product_2'));

I would like to clear my custom blocks the same way, but that doesn't seem to work.

Any input for this?

gety9 commented 6 years ago

@mortenjakobsen

Did you find the solution for this?

I need a way to clear cache of specific block not the full page.

mortenjakobsen commented 6 years ago

My colleague ended up implementing the fix... If I recall correctly, he made some changes to the save observer, and added custom handles for the blocks when saved, so we had the ability to clear this way.