Opened 16 years ago

Closed 10 days ago

#11479 closed Bug (fixed)

cache_page and last_modified decorators can't be used together

Reported by: megaman821@… Owned by: nobody
Component: Core (Cache system) Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The function the calculates the last_modified date will always run but since the cache_page decorator ends up calling a middleware it will get to the last_modified and etag headers first. It will see that they are empty (because only another middleware could have changed them at that point) and then set them to default values. Then the last_modified decorator will see the last modified header is already set and not change it.

Change History (5)

comment:1 by Alex Gaynor, 16 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Julien Phalip, 14 years ago

Severity: Normal
Type: Bug

comment:3 by Aymeric Augustin, 14 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:4 by Aymeric Augustin, 14 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:5 by Joel D Sleppy, 10 days ago

Resolution: fixed
Status: newclosed

The UpdateCacheMiddleware does not set the "Last-Modified" header under any circumstances anymore, so the issue as described in this ticket does not exist in modern Django. This was changed in Django 1.11 by this commit https://github.com/django/django/commit/9e07a9b5feb30fe06fb23d0e77edd34f6c3f92b5

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