pimcore

How do I clear output cache in Pimcore programmatically?


Note that this is not disable output cache which only disable for certain request, as what the documentation specified.


Solution

  • Found this in Pimcore 4 source code in pimcore/models/Object/ClassDefinition.php

    // empty output cache
    try {
       Cache::clearTag("output");
    } catch (\Exception $e) {
    } ?>
    

    Although I don't really agree on how this works (they did not specify that "output" is a reserved keyword for cache tags).