• AlveElde's avatar
    expire: Introduce EXP_Reduce() · 9c0abf0c
    AlveElde authored
    This commit introduces EXP_Reduce(), a function to reduce object timers.
    The goal is to provide a function better suited to soft-purging objects,
    as EXP_Rearm() has some non-obvious disadvantages when used or this
    purpose.
    
    When EXP_Rearm() is used to soft-purge an object by setting its TTL to
    0, the expiry is effectively reset to the start of the objects grace
    period. This happens because the object TTL includes a time delta
    between object insertion time (oc->t_origin) and now. The result is that
    a soft-purge extends the lifetime of an already stale object, and
    repeated soft-purges can keep the object away from expiry indefinitely.
    
    The EXP_Reduce() function is better suited for soft-purging, as it only
    updates an objects TTL if it would reduce the objects lifetime. The
    function also has facilities for reducing grace and keep.
    9c0abf0c
cache_varnishd.h 18 KB