1

Example: FPC lifetime is 1 day but a page contains a block with a lifetime of 1 hour. How will that be handled? Will the page be served from the cache after the hour?

1

It did a quick test on it:

  • I did set the FPC lifetime to 60 second
  • I wrote a block and overrode \Magento\Framework\View\Element\AbstractBlock::getCacheLifetime to return 30
  • Additionally I set ttl="30" in layout xml

Without the block the FPC lifetime was 60 seconds as expected. Then I inserted the block on the page and the FPC lifetime was still 60 seconds, the block was unaffected of the given 30 seconds.

Maybe I did set the cache lifetime of the block wrong but it seems like the FPC just ignores any lifetime set in the block.

  • 1
    I hate that - I think it should work differently. – Alex Jan 23 at 13:03

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.