eZ Community » Blogs » Gaetano Giunta » The definitive guide to Cache Block...

By

The definitive guide to Cache Block expiry rules

Monday 04 June 2012 10:56:07 pm

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Everyone loves cache blocks, right?

And I am sure everyone here can tell me the difference between usage of  and subtree_expiry and ignore_content_expiry (note for the casual reader: it is: "use the latter if you can, try to addalways use the former when you can not").

But what if I was to ask: "cache block expiration is triggered by content publishing. What happens with all other operations, such as assigning obj state or section?"

Bear with me to find out...

Given a cache block configured with expiry=0 subtree_expiry=XXX, the following is an almost-complete list of  tests about actions that trigger (or not) its expiration:

  • create/publish node in subtree: expires
  • change object state(s) to node in subtree: expires
  • change object state(s) to node outside subtree: does not expire
  • set section to node in subtree: does not expire => BUG
  • set section to node outside subtree: does not expire
  • add location inside subtree to node outside subtree: expires
  • add location outside subtree to node outside subtree: does not expire
  • add location inside subtree to node inside subtree: expires
  • add location outside subtree to node inside subtree: expires
  • remove location outside subtree to a node outside subtree: does not expire
  • remove location outside subtree to a node inside subtree: expires (too zealous?)
  • remove location inside subtree to a node inside subtree: expires
  • set main location to a node inside subtree: expires (also if node in subtree is 2ndary and 1ary is changed between 2 locations outside subtree)
  • set main location to a node outside subtree: does not expire
  • move node from inside subtree to outside it: expires
  • move node from outside subtree to inside it: expires
  • hide node inside subtree: expires*
  • hide node outside subtree: does not expireexpire
  • hide location outside subtree to a node inside subtree: expires* (too zealous?)

* = even when changing visibility happens because of parent node getting hidden/shown

  • add urlalias to node inside subtree: does not expire => BUG ?
  • add/remove translation to node inside subtree: expires
  • change sort order to node inside subtree: expires
  • change main translation to node inside subtree: expires
  • change the "always available regardless of language" field to node inside subtree: expires

[note: all of these have been tested using eZP 4.6]