Opened 10 years ago

Closed 5 years ago

#3680 closed New feature (fixed)

Add cache control (ETag, Last Modified) to django.contrib.syndication

Reported by: jerf@… Owned by: nobody
Component: contrib.syndication Version: master
Severity: Normal Keywords:
Cc: Ben Firshman, tom@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Because RSS feeds can be the hardest hit part of a website, they need to be as efficient as possible; they are often the "inner loop" of a website. Good support for being able to return 304 with as little cost as possible is necessary, preferably as easily as possible.

Attachments (1)

cache.control.on.syndication.code.only.diff (6.2 KB) - added by jerf@… 10 years ago.
a code only prototype of the cache system, for discussion purposes

Download all attachments as: .zip

Change History (11)

Changed 10 years ago by jerf@…

a code only prototype of the cache system, for discussion purposes

comment:1 Changed 10 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedAccepted

comment:2 Changed 10 years ago by jerf@…

Hang on, my impression of this is that it was rejected by discussion on the list.

If it is something that Django wishes to add, I think I've got a slightly better patch locally, I'm happy to write docs, and I'll burn it in on my own site before submitting it (since now the only thing to shoot for is 1.0, which I presume is a ways off). But I don't want to put any work on it if it's just going to be rejected.

comment:3 Changed 10 years ago by Malcolm Tredinnick

Owner: changed from Adrian Holovaty to Malcolm Tredinnick

The intention of your changes is correct, that was never rejected -- allowing early bailout is a worthy goal. I'm not sure your patch is doing the work in the right place, but it's probably pretty close. Attach your best patch so that we can review it and either apply it or do something similar.

comment:4 Changed 8 years ago by anonymous

Resolution: fixed
Status: newclosed

comment:5 Changed 8 years ago by anonymous

Resolution: fixed
Status: closedreopened

comment:6 Changed 7 years ago by Ben Firshman

Cc: Ben Firshman added
Component: Contrib appsRSS framework

Can't this be done with Django's existing caching tools now feeds are views?

http://docs.djangoproject.com/en/1.2/topics/cache/

comment:7 Changed 6 years ago by Julian Bez

ConditionalGetMiddleware should do the work of responding with 304 etc. so that's not needed here.

#7936 also is specifically about the Last-Modified issue and has a nice patch for it.

comment:8 Changed 6 years ago by Łukasz Rekucki

Severity: Normal
Type: New feature

comment:9 Changed 6 years ago by Tom Christie

Cc: tom@… added
Easy pickings: unset

comment:10 Changed 5 years ago by Aymeric Augustin

Resolution: fixed
Status: reopenedclosed
UI/UX: unset

Django now provides general-purpose caching features that cover the scope of this ticket.

Use the condition decorator on your feed views: my_feed_view = condition(etag_func=..., last_modified_func=...)(MyFeedClass())

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