Fix caching issues in the diff viewer with interdiffs.
Review Request #7709 — Created Oct. 17, 2015 and submitted
The diff viewer had a caching bug that people noticed when using
interdiffs. Essentially, updating the diff and viewing its interdiff
resulted in the old diff being displayed.The reason this happened is that
DiffFragmentView.make_etag()
was
expecting aDiffSet
ID, but this wasn't actually available at this
point. We didn't have DiffSet information until later, after the caching
checks, so we couldn't include any of its identifying information.Rather than regress the performance of the diff viewer by moving the
database access before the caching checks, I've opted to extend the URL
format to take an interfilediff ID. This gives us all the information
needed to sanely cache fragments without incurring any performance
penalties.
Tested diffs and interdiffs of different types in the diff viewer. Saw that
the content had a new ETag every time a diff was updated, and for every
diff revision range.Unit tests pass (both Python and JavaScript).
Description | From | Last Updated |
---|---|---|
Two typos: "a a subclass's" should be "a subclass'". |
AD adriano | |
Care to add Args and Returns here? |
|
- Change Summary:
-
- Fixed a typo.
- Updated a docstring to include argument and return information.
![reviewbot](https://reviews.reviewboard.org/static/ext/reviewbotext.extension.ReviewBotExtension/images/reviewbot.png)
-
Tool: Pyflakes Processed Files: reviewboard/diffviewer/views.py reviewboard/reviews/urls.py Ignored Files: reviewboard/static/rb/js/diffviewer/models/diffReviewableModel.js reviewboard/static/rb/js/diffviewer/models/tests/diffReviewableModelTests.js Tool: PEP8 Style Checker Processed Files: reviewboard/diffviewer/views.py reviewboard/reviews/urls.py Ignored Files: reviewboard/static/rb/js/diffviewer/models/diffReviewableModel.js reviewboard/static/rb/js/diffviewer/models/tests/diffReviewableModelTests.js