I don't know or this is wrong in the documentation or in the code. The function 'cache_get' has documented:

 *   - CACHE_TEMPORARY: Indicates that the item should be removed at the next
 *     general cache wipe.

However when life time is on and the general wipe is done the temporary cache ain't removed at the moment. Because I think the code is leading there should be added a little. After fixing this the test at http://drupal.org/node/276267 should be fixed.

Comments

R.Muilwijk’s picture

Last paragraph should be:

However when life time is on and the general wipe is done the temporary cache ain't removed at the moment. Because I think the code is leading there should be added a little comment with th exeption when life is enabled. After fixing this the test at http://drupal.org/node/276267 should be fixed.

catch’s picture

I think this is the same bug Morbus brought up in http://lists.drupal.org/pipermail/development/2008-June/030247.html (no solution there either)

Could we make minimum lifetime one second or something?

R.Muilwijk’s picture

nah, that is the one that makes

cache_clear_all('', 'cache')'

never called so you can't really use expiry in the 'cache' table.

This bug however shows a wrong documentation or wrong implemented code. The code says when using life time the cache stays for that period of time but the documentation says it will be removed after every general wipe.

My suggestion is to add to the documentation something like:

 *   - CACHE_TEMPORARY: Indicates that the item should be removed at the next
*     general cache wipe or when cache lifetime is enabled after it's expirations first wipe.
catch’s picture

Just a note that there's a patch which was applied to D6 but never made it into D7 that's at least somewhat related. The test still fails wth it applied though #226728: Temporary cache table entries are not flushed.

yonailo’s picture

catch, can you point us to the patch you are talking about ?

Thanks.

catch’s picture

sime’s picture

Status: Active » Closed (duplicate)

Linked issue is now for D7, makes this a duplicate now, I assume.