colinmollenhour/Cm_Cache_Backend_Redis — pull request #56 by nemphys (2013-11-06 22:55:12+00:00)
Title: use a lua script for garbage collection (if use_lua is enabled in config)

Much better than the current implementation, does the job atomically and does not slow down responses while doing so (except when "cleaning" really heavy tags like Block_Html, but the small delay there should be acceptable).

Tested on production server and looks good.

The only drawback is that it fetches all tags in the beginning, so if a new tags is added during the process it will not be checked; should not matter (since a brand new tags should not have many garbage keys) and it can always be cleaned up on the next run.