Skip to content

Set without affecting item age #104

@andreyrd

Description

@andreyrd

Sometimes I want to update an item without updating the age of the item.

Maybe this could be done with a flag on set(key, value, maxAge, updateNow). And then set could be updated here: https://github.com/isaacs/node-lru-cache/blob/master/lib/lru-cache.js#L321

From:

item.now = now

To:

updateNow = updateNow || updateNow == null // Default to true
...
if (updateNow) { item.now = now }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions