Example: We have a Full Page Cached Category Page, How System Know Weather To Send Cached Data as a Response, Or Hit Database and Send response. If it uses any cache tag, where does it check?
1 Answer
Almost all of the block classes extend to the class
\Magento\Framework\View\Element\Template
which also extends to the abstract class
\Magento\Framework\View\Element\AbstractBlock
and with fpp activated the block html is always loaded from cache. In the abstrtact class, have a look on the toHtml() and _loadCache() functions, where the check and the load is happening. If you add in your block class the following function then the block html is not loaded from cache.
public function getCacheLifetime()
{
return null;
}