Closed
Bug 753483
Opened 13 years ago
Closed 13 years ago
kuma: Support conditional GET headers for document view caching
Categories
(developer.mozilla.org Graveyard :: Editing, defect)
developer.mozilla.org Graveyard
Editing
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: lorchard, Assigned: lorchard)
References
Details
(Whiteboard: u=contributor c=wiki s=2012-05-22 p=2 t=2012-05-29)
Requesting a document from kuma should support conditional GET headers for caching.
So, when a doc is requested, it should serve up Last-Modified and Etag reflecting the state of the doc.
Later, when a doc is request with the If-Modified-Since and/or If-None-Match headers, and the values match the current state of the requested doc, respond with a 304 Not Modified and no body.
An implementation hint, if a Django decorator doesn't do this already: Optimize by stashing last known Last-Modified and Etag in memcache, keyed on doc full path (ie. {doc-locale}/{doc-slug}) for a quick 304 Not Modified exit as early as possible in the doc view code.
Assignee | ||
Updated•13 years ago
|
Whiteboard: u=contributor c=wiki s=2012-05-22 p=2
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → lorchard
Assignee | ||
Comment 1•13 years ago
|
||
After some head-desk-ing, I have discovered: the Django CSRF middleware deletes the ETag header from responses. Luckily, last-modified should be plenty for purposes here.
Assignee | ||
Comment 2•13 years ago
|
||
Progress: https://github.com/mozilla/kuma/pull/214
Comment 3•13 years ago
|
||
Commits pushed to master at https://github.com/mozilla/kuma
https://github.com/mozilla/kuma/commit/519c8030c451b52dc30c804cc2063afe33827415
fix bug 753483 - Conditional GET on document view
* Use @condition decorator on document view for conditional GET
* Cache document last-modified as UNIX timestamp
* Invalidate last-modified cache on Document save()
* Give up on ETag, since it gets deleted from outgoing headers by CSRF
middleware.
* Tests
https://github.com/mozilla/kuma/commit/c5942ddeab7243a63dbe44c8781b7dc38bcc55a8
Merge pull request #214 from lmorchard/753483-doc-conditional-get
fix bug 753483 - Conditional GET on document view
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Whiteboard: u=contributor c=wiki s=2012-05-22 p=2 → u=contributor c=wiki s=2012-05-22 p=2 t=2012-05-29
Updated•12 years ago
|
Version: Kuma → unspecified
Updated•12 years ago
|
Component: Docs Platform → Editing
Updated•5 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•