0

When APCu cache space becomes full, APC simply clears it off all its data so as to regain free cache space.

Is there a PHP way to know when this happens ?

JLuc
  • 333
  • 5
  • 15
  • Why should that be relevant? The cache data is recreated on the fly in a transparent way. – arkascha Oct 27 '18 at 07:38
  • For house keeping and statistics. And potentialy to adapt some strategies in case cached value computation is heavy. – JLuc Oct 27 '18 at 07:57
  • It might be interesting also to follow free space and trigger some event in advance, when free space is statisticaly about to be missing soon. – JLuc Oct 28 '18 at 08:26
  • OK, if you want to dive into that: what about the API APCu offers: nothing in there that might be useful? – arkascha Oct 28 '18 at 11:29
  • Yes, asking for cache space and free space is ok with the API. – JLuc Oct 28 '18 at 15:54

1 Answers1

0

Cache some dedicated cache tag ("cached" => "yes", longlastingvalidity) and check whether its still there, or not. When it's not there anymore : the cache has been flushed.

JLuc
  • 333
  • 5
  • 15