Skip to content

Add option for cache.WithExpireAfterWrite #1272

@orrk-litt

Description

@orrk-litt

Please describe your feature request:

When working with stored/persistent OOB interaction (for example stored XSS) the current eviction mechanism may not remove the registration. Repeated interactions keep accessing the cache item, which increases the TTL and can delay eviction indefinitely.

Changing the storage eviction from cache.WithExpireAfterAccess to cache.WithExpireAfterWrite handles this use case and makes sure an eviction occurs after the specified eviction period.

Since changing behavior can break some other use-cases, I suggest adding a flag to the server command line to control the eviction strategy (for example --eviction-strategy fixed vs the default --eviction-strategy sliding).

Describe the use case of this feature:

  • stored OOB may cause the registration stay forever

I've implemented a local fix and am happy to open a Pull Request for this feature if the solution is acceptable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: EnhancementMost issues will probably ask for additions or changes.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions