Opened 8 years ago

Closed 4 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: bfirsh, 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@… 8 years ago.
a code only prototype of the cache system, for discussion purposes

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by jerf@…

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

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 8 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 8 years ago by mtredinnick

  • Owner changed from adrian to mtredinnick

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 7 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

comment:5 Changed 7 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:6 Changed 5 years ago by bfirsh

  • Cc bfirsh added
  • Component changed from Contrib apps to RSS 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 5 years ago by julianb

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 4 years ago by lrekucki

  • Severity set to Normal
  • Type set to New feature

comment:9 Changed 4 years ago by tomchristie

  • Cc tom@… added
  • Easy pickings unset

comment:10 Changed 4 years ago by aaugustin

  • Resolution set to fixed
  • Status changed from reopened to closed
  • 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