[Django] #27480: A method to touch an entry in a cache

20 views
Skip to first unread message

Django

unread,
Nov 12, 2016, 12:54:34 PM11/12/16
to django-...@googlegroups.com
#27480: A method to touch an entry in a cache
-----------------------------------------------+------------------------
Reporter: Victor Porton | Owner: nobody
Type: New feature | Status: new
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------------+------------------------
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)`.

--
Ticket URL: <https://code.djangoproject.com/ticket/27480>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 12, 2016, 1:08:25 PM11/12/16
to django-...@googlegroups.com
#27480: A method to touch an entry in a cache
-------------------------------------+-------------------------------------

Reporter: Victor Porton | Owner: nobody
Type: New feature | Status: new
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Victor Porton):

It also should have optional `timeout` argument.

--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:1>

Django

unread,
Nov 16, 2016, 7:39:00 AM11/16/16
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+------------------------------------

Reporter: Victor Porton | Owner: nobody
Type: New feature | Status: new
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:2>

Django

unread,
Nov 19, 2016, 4:23:36 AM11/19/16
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: Nicolas
| Noé
Type: New feature | Status: assigned

Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nicolas Noé):

* owner: nobody => Nicolas Noé
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:3>

Django

unread,
Nov 24, 2016, 4:53:08 AM11/24/16
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: Nicolas
| Noé
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nicolas Noé):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:4>

Django

unread,
Nov 24, 2016, 6:14:49 AM11/24/16
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: Nicolas
| Noé
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1


Comment:

Comments for improvement are on the
[https://github.com/django/django/pull/7610 PR].

--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:5>

Django

unread,
Dec 13, 2016, 9:19:44 AM12/13/16
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: Nicolas
| Noé
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nicolas Noé):

* needs_better_patch: 1 => 0


Comment:

Patch was improved, please review.

--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:6>

Django

unread,
Dec 16, 2016, 12:14:57 PM12/16/16
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: Nicolas
| Noé
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Accepted => Someday/Maybe


Comment:

This is blocked on two fixes for python-memcached
([https://github.com/linsomniac/python-memcached/pull/107 PR #107],
[https://github.com/linsomniac/python-memcached/pull/108 PR #108]) so that
the Django tests can use the latest version (#25277) where `touch()`
works.

--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:7>

Django

unread,
Mar 20, 2018, 4:30:09 AM3/20/18
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: Nicolas
| Noé
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nicolas Noé):

* stage: Someday/Maybe => Accepted


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:8>

Django

unread,
Apr 27, 2018, 5:49:04 PM4/27/18
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: Nicolas
| Noé
Type: New feature | Status: closed

Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"3246ad106517e61437f80e8ef3c9d216754039e7" 3246ad10]:
{{{
#!CommitTicketReference repository=""
revision="3246ad106517e61437f80e8ef3c9d216754039e7"
Fixed #27480 -- Added cache.touch().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:9>

Django

unread,
Jul 9, 2018, 12:12:37 PM7/9/18
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: Nicolas
| Noé
Type: New feature | Status: closed
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"2d75509bcb1db910da3c568f99b6ac778a79a98f" 2d75509b]:
{{{
#!CommitTicketReference repository=""
revision="2d75509bcb1db910da3c568f99b6ac778a79a98f"
Refs #27480 -- Moved FileBasedCache content writing logic to a method.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:10>

Django

unread,
Aug 20, 2020, 3:04:36 AM8/20/20
to django-...@googlegroups.com
#27480: Add a Cache.touch(key, timeout=DEFAULT_TIMEOUT) method
-------------------------------------+-------------------------------------
Reporter: Victor Porton | Owner: Nicolas
| Noé
Type: New feature | Status: closed
Component: Core (Cache system) | Version: 1.10
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"e2013b260a8f689eee280d00b96a9507895ec236" e2013b26]:
{{{
#!CommitTicketReference repository=""
revision="e2013b260a8f689eee280d00b96a9507895ec236"
Refs #29887, #27480 -- Moved touch() to BaseMemcachedCache.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27480#comment:11>

Reply all
Reply to author
Forward
0 new messages