Opened 6 years ago

Closed 4 years ago

Last modified 2 years ago

#27480 closed New feature (fixed)

Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method

Reported by: Victor Porton Owned by: Nicolas Noé
Component: Core (Cache system) Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I do cache.set(crypt, cache.get(crypt)) in order to prolong the life of an entry of the cache.

There should be a shorter easier way like: cache.touch(crypt).

Change History (11)

comment:1 Changed 6 years ago by Victor Porton

It also should have optional timeout argument.

comment:2 Changed 6 years ago by Tim Graham

Summary: A method to touch an entry in a cacheAdd a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
Triage Stage: UnreviewedAccepted

Seems reasonable since python-memcached and pyblicmc both implement a touch() method, I think.

comment:3 Changed 6 years ago by Nicolas Noé

Owner: changed from nobody to Nicolas Noé
Status: newassigned

comment:4 Changed 6 years ago by Nicolas Noé

Has patch: set

comment:5 Changed 6 years ago by Tim Graham

Patch needs improvement: set

Comments for improvement are on the PR.

comment:6 Changed 6 years ago by Nicolas Noé

Patch needs improvement: unset

Patch was improved, please review.

comment:7 Changed 6 years ago by Tim Graham

Triage Stage: AcceptedSomeday/Maybe

This is blocked on two fixes for python-memcached (PR #107, PR #108) so that the Django tests can use the latest version (#25277) where touch() works.

comment:8 Changed 5 years ago by Nicolas Noé

Triage Stage: Someday/MaybeAccepted

Python-memcached blocking issues solved and patch updated, please review.

comment:9 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 3246ad10:

Fixed #27480 -- Added cache.touch().

comment:10 Changed 4 years ago by Tim Graham <timograham@…>

In 2d75509b:

Refs #27480 -- Moved FileBasedCache content writing logic to a method.

comment:11 Changed 2 years ago by Mariusz Felisiak <felisiak.mariusz@…>

In e2013b26:

Refs #29887, #27480 -- Moved touch() to BaseMemcachedCache.

Note: See TracTickets for help on using tickets.
Back to Top